summaryrefslogtreecommitdiffstats
path: root/modules/freetype2/src/tools
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-15 20:21:34 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-15 20:21:34 +0200
commit9c075dc4cdaeef79bc570ed2219bb757cb325c47 (patch)
treecda2be4b94e235a7c742b0598ee4b13478c1c7b8 /modules/freetype2/src/tools
parent7bd7473702918934b4f5751a583c3f459bb06c7b (diff)
downloadUXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar
UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.gz
UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.lz
UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.tar.xz
UXP-9c075dc4cdaeef79bc570ed2219bb757cb325c47.zip
Update in-tree freetype2 lib (unused) to 2.9.1
Diffstat (limited to 'modules/freetype2/src/tools')
-rw-r--r--modules/freetype2/src/tools/afblue.pl2
-rw-r--r--modules/freetype2/src/tools/apinames.c19
-rw-r--r--modules/freetype2/src/tools/docmaker/content.py45
-rw-r--r--modules/freetype2/src/tools/docmaker/docbeauty.py18
-rw-r--r--modules/freetype2/src/tools/docmaker/docmaker.py26
-rw-r--r--modules/freetype2/src/tools/docmaker/formatter.py2
-rw-r--r--modules/freetype2/src/tools/docmaker/sources.py14
-rw-r--r--modules/freetype2/src/tools/docmaker/tohtml.py104
-rw-r--r--modules/freetype2/src/tools/docmaker/utils.py2
-rw-r--r--modules/freetype2/src/tools/ftfuzzer/README12
-rw-r--r--modules/freetype2/src/tools/ftfuzzer/ftfuzzer.cc100
-rw-r--r--modules/freetype2/src/tools/ftfuzzer/ftmutator.cc2
-rw-r--r--modules/freetype2/src/tools/ftfuzzer/rasterfuzzer.cc2
-rw-r--r--modules/freetype2/src/tools/ftfuzzer/runinput.cc2
-rw-r--r--modules/freetype2/src/tools/glnames.py34
-rwxr-xr-xmodules/freetype2/src/tools/update-copyright-year2
16 files changed, 231 insertions, 155 deletions
diff --git a/modules/freetype2/src/tools/afblue.pl b/modules/freetype2/src/tools/afblue.pl
index 39fe5c584..7c6f1a7df 100644
--- a/modules/freetype2/src/tools/afblue.pl
+++ b/modules/freetype2/src/tools/afblue.pl
@@ -5,7 +5,7 @@
#
# Process a blue zone character data file.
#
-# Copyright 2013-2016 by
+# Copyright 2013-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/apinames.c b/modules/freetype2/src/tools/apinames.c
index 73bc99de5..06c326043 100644
--- a/modules/freetype2/src/tools/apinames.c
+++ b/modules/freetype2/src/tools/apinames.c
@@ -22,7 +22,7 @@
#include <ctype.h>
#define PROGRAM_NAME "apinames"
-#define PROGRAM_VERSION "0.2"
+#define PROGRAM_VERSION "0.3"
#define LINEBUFF_SIZE 1024
@@ -32,7 +32,8 @@ typedef enum OutputFormat_
OUTPUT_WINDOWS_DEF, /* output a Windows .DEF file for Visual C++ or Mingw */
OUTPUT_BORLAND_DEF, /* output a Windows .DEF file for Borland C++ */
OUTPUT_WATCOM_LBC, /* output a Watcom Linker Command File */
- OUTPUT_NETWARE_IMP /* output a NetWare ImportFile */
+ OUTPUT_NETWARE_IMP, /* output a NetWare ImportFile */
+ OUTPUT_GNU_VERMAP /* output a version map for GNU or Solaris linker */
} OutputFormat;
@@ -198,6 +199,15 @@ names_dump( FILE* out,
}
break;
+ case OUTPUT_GNU_VERMAP:
+ {
+ fprintf( out, "{\n\tglobal:\n" );
+ for ( nn = 0; nn < num_names; nn++ )
+ fprintf( out, "\t\t%s;\n", the_names[nn].name );
+ fprintf( out, "\tlocal:\n\t\t*;\n};\n" );
+ }
+ break;
+
default: /* LIST */
for ( nn = 0; nn < num_names; nn++ )
fprintf( out, "%s\n", the_names[nn].name );
@@ -323,6 +333,7 @@ usage( void )
" -wB : output .DEF file for Borland C++\n"
" -wW : output Watcom Linker Response File\n"
" -wN : output NetWare Import File\n"
+ " -wL : output version map for GNU or Solaris linker\n"
"\n";
fprintf( stderr,
@@ -410,6 +421,10 @@ int main( int argc, const char* const* argv )
format = OUTPUT_NETWARE_IMP;
break;
+ case 'L':
+ format = OUTPUT_GNU_VERMAP;
+ break;
+
case 0:
break;
diff --git a/modules/freetype2/src/tools/docmaker/content.py b/modules/freetype2/src/tools/docmaker/content.py
index 438345c41..198780aee 100644
--- a/modules/freetype2/src/tools/docmaker/content.py
+++ b/modules/freetype2/src/tools/docmaker/content.py
@@ -3,7 +3,7 @@
#
# Parse comment blocks to build content blocks (library file).
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -109,7 +109,7 @@ class DocCode:
def dump( self, prefix = "", width = 60 ):
lines = self.dump_lines( 0, width )
for l in lines:
- print prefix + l
+ print( prefix + l )
def dump_lines( self, margin = 0, width = 60 ):
result = []
@@ -139,7 +139,7 @@ class DocPara:
def dump( self, prefix = "", width = 60 ):
lines = self.dump_lines( 0, width )
for l in lines:
- print prefix + l
+ print( prefix + l )
def dump_lines( self, margin = 0, width = 60 ):
cur = "" # current line
@@ -243,13 +243,13 @@ class DocField:
def dump( self, prefix = "" ):
if self.field:
- print prefix + self.field + " ::"
+ print( prefix + self.field + " ::" )
prefix = prefix + "----"
first = 1
for p in self.items:
if not first:
- print ""
+ print( "" )
p.dump( prefix )
first = 0
@@ -330,10 +330,10 @@ class DocMarkup:
return None
def dump( self, margin ):
- print " " * margin + "<" + self.tag + ">"
+ print( " " * margin + "<" + self.tag + ">" )
for f in self.fields:
f.dump( " " )
- print " " * margin + "</" + self.tag + ">"
+ print( " " * margin + "</" + self.tag + ">" )
################################################################
@@ -453,15 +453,32 @@ class ContentProcessor:
markup_lines = []
first = 1
+ margin = -1
+ in_code = 0
+
for line in content:
- found = None
- for t in re_markup_tags:
- m = t.match( line )
+ if in_code:
+ m = re_code_end.match( line )
+ if m and len( m.group( 1 ) ) <= margin:
+ in_code = 0
+ margin = -1
+ else:
+ m = re_code_start.match( line )
if m:
- found = string.lower( m.group( 1 ) )
- prefix = len( m.group( 0 ) )
- line = " " * prefix + line[prefix:] # remove markup from line
- break
+ in_code = 1
+ margin = len( m.group( 1 ) )
+
+ found = None
+
+ if not in_code:
+ for t in re_markup_tags:
+ m = t.match( line )
+ if m:
+ found = string.lower( m.group( 1 ) )
+ prefix = len( m.group( 0 ) )
+ # remove markup from line
+ line = " " * prefix + line[prefix:]
+ break
# is it the start of a new markup section ?
if found:
diff --git a/modules/freetype2/src/tools/docmaker/docbeauty.py b/modules/freetype2/src/tools/docmaker/docbeauty.py
index 3ddf4a94a..0b021fa6c 100644
--- a/modules/freetype2/src/tools/docmaker/docbeauty.py
+++ b/modules/freetype2/src/tools/docmaker/docbeauty.py
@@ -10,9 +10,7 @@ from sources import *
from content import *
from utils import *
-import utils
-
-import sys, os, time, string, getopt
+import sys, os, string, getopt
content_processor = ContentProcessor()
@@ -40,13 +38,13 @@ def beautify_block( block ):
def usage():
- print "\nDocBeauty 0.1 Usage information\n"
- print " docbeauty [options] file1 [file2 ...]\n"
- print "using the following options:\n"
- print " -h : print this page"
- print " -b : backup original files with the 'orig' extension"
- print ""
- print " --backup : same as -b"
+ print( "\nDocBeauty 0.1 Usage information\n" )
+ print( " docbeauty [options] file1 [file2 ...]\n" )
+ print( "using the following options:\n" )
+ print( " -h : print this page" )
+ print( " -b : backup original files with the 'orig' extension" )
+ print( "" )
+ print( " --backup : same as -b" )
def main( argv ):
diff --git a/modules/freetype2/src/tools/docmaker/docmaker.py b/modules/freetype2/src/tools/docmaker/docmaker.py
index aa8899664..eb49afb0a 100644
--- a/modules/freetype2/src/tools/docmaker/docmaker.py
+++ b/modules/freetype2/src/tools/docmaker/docmaker.py
@@ -4,7 +4,7 @@
#
# Convert source code markup to HTML documentation.
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -31,21 +31,21 @@ from tohtml import *
import utils
-import sys, os, time, string, glob, getopt
+import sys, glob, getopt
def usage():
- print "\nDocMaker Usage information\n"
- print " docmaker [options] file1 [file2 ...]\n"
- print "using the following options:\n"
- print " -h : print this page"
- print " -t : set project title, as in '-t \"My Project\"'"
- print " -o : set output directory, as in '-o mydir'"
- print " -p : set documentation prefix, as in '-p ft2'"
- print ""
- print " --title : same as -t, as in '--title=\"My Project\"'"
- print " --output : same as -o, as in '--output=mydir'"
- print " --prefix : same as -p, as in '--prefix=ft2'"
+ print( "\nDocMaker Usage information\n" )
+ print( " docmaker [options] file1 [file2 ...]\n" )
+ print( "using the following options:\n" )
+ print( " -h : print this page" )
+ print( " -t : set project title, as in '-t \"My Project\"'" )
+ print( " -o : set output directory, as in '-o mydir'" )
+ print( " -p : set documentation prefix, as in '-p ft2'" )
+ print( "" )
+ print( " --title : same as -t, as in '--title=\"My Project\"'" )
+ print( " --output : same as -o, as in '--output=mydir'" )
+ print( " --prefix : same as -p, as in '--prefix=ft2'" )
def main( argv ):
diff --git a/modules/freetype2/src/tools/docmaker/formatter.py b/modules/freetype2/src/tools/docmaker/formatter.py
index c47589048..2708fd40d 100644
--- a/modules/freetype2/src/tools/docmaker/formatter.py
+++ b/modules/freetype2/src/tools/docmaker/formatter.py
@@ -3,7 +3,7 @@
#
# Convert parsed content blocks to a structured document (library file).
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/docmaker/sources.py b/modules/freetype2/src/tools/docmaker/sources.py
index 3d30c7277..e3b95e0fa 100644
--- a/modules/freetype2/src/tools/docmaker/sources.py
+++ b/modules/freetype2/src/tools/docmaker/sources.py
@@ -3,7 +3,7 @@
#
# Convert source code comments to multi-line blocks (library file).
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -29,7 +29,7 @@
#
-import fileinput, re, sys, os, string
+import fileinput, re, string
################################################################
@@ -171,7 +171,7 @@ re_bold = re.compile( r"\*((?:\w|-)(?:\w|'|-)*)\*(.*)" ) # *bold*
#
# This regular expression code to identify an URL has been taken from
#
-# http://mail.python.org/pipermail/tutor/2002-September/017228.html
+# https://mail.python.org/pipermail/tutor/2002-September/017228.html
#
# (with slight modifications).
#
@@ -296,10 +296,10 @@ class SourceBlock:
# debugging only -- not used in normal operations
def dump( self ):
if self.content:
- print "{{{content start---"
+ print( "{{{content start---" )
for l in self.content:
- print l
- print "---content end}}}"
+ print( l )
+ print( "---content end}}}" )
return
fmt = ""
@@ -307,7 +307,7 @@ class SourceBlock:
fmt = repr( self.format.id ) + " "
for line in self.lines:
- print line
+ print( line )
################################################################
diff --git a/modules/freetype2/src/tools/docmaker/tohtml.py b/modules/freetype2/src/tools/docmaker/tohtml.py
index 9b28780e9..9f318a2a4 100644
--- a/modules/freetype2/src/tools/docmaker/tohtml.py
+++ b/modules/freetype2/src/tools/docmaker/tohtml.py
@@ -3,7 +3,7 @@
#
# A sub-class container of the `Formatter' class to produce HTML.
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
@@ -25,7 +25,7 @@ import time
# The following strings define the HTML header used by all generated pages.
html_header_1 = """\
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
-"http://www.w3.org/TR/html4/loose.dtd">
+"https://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
@@ -406,7 +406,7 @@ class HtmlFormatter( Formatter ):
return string.join( lines, '\n' )
def print_html_items( self, items ):
- print self.make_html_items( items )
+ print( self.make_html_items( items ) )
def print_html_field( self, field ):
if field.name:
@@ -414,10 +414,10 @@ class HtmlFormatter( Formatter ):
+ field.name
+ "</b></td><td>" )
- print self.make_html_items( field.items )
+ print( self.make_html_items( field.items ) )
if field.name:
- print "</td></tr></table>"
+ print( "</td></tr></table>" )
def html_source_quote( self, line, block_name = None ):
result = ""
@@ -468,14 +468,14 @@ class HtmlFormatter( Formatter ):
return result
def print_html_field_list( self, fields ):
- print '<table class="fields">'
+ print( '<table class="fields">' )
for field in fields:
- print ( '<tr><td class="val" id="' + field.name + '">'
- + field.name
- + '</td><td class="desc">' )
+ print( '<tr><td class="val" id="' + field.name + '">'
+ + field.name
+ + '</td><td class="desc">' )
self.print_html_items( field.items )
- print "</td></tr>"
- print "</table>"
+ print( "</td></tr>" )
+ print( "</table>" )
def print_html_markup( self, markup ):
table_fields = []
@@ -499,7 +499,7 @@ class HtmlFormatter( Formatter ):
# formatting the index
#
def index_enter( self ):
- print self.html_index_header
+ print( self.html_index_header )
self.index_items = {}
def index_name_enter( self, name ):
@@ -512,7 +512,7 @@ class HtmlFormatter( Formatter ):
count = len( self.block_index )
rows = ( count + self.columns - 1 ) // self.columns
- print '<table class="index">'
+ print( '<table class="index">' )
for r in range( rows ):
line = "<tr>"
for c in range( self.columns ):
@@ -531,15 +531,15 @@ class HtmlFormatter( Formatter ):
else:
line = line + '<td></td>'
line = line + "</tr>"
- print line
+ print( line )
- print "</table>"
+ print( "</table>" )
print( index_footer_start
+ self.file_prefix + "toc.html"
+ index_footer_end )
- print self.html_footer
+ print( self.html_footer )
self.index_items = {}
@@ -553,25 +553,25 @@ class HtmlFormatter( Formatter ):
# formatting the table of contents
#
def toc_enter( self ):
- print self.html_toc_header
- print "<h1>Table of Contents</h1>"
+ print( self.html_toc_header )
+ print( "<h1>Table of Contents</h1>" )
def toc_chapter_enter( self, chapter ):
- print chapter_header + string.join( chapter.title ) + chapter_inter
- print '<table class="toc">'
+ print( chapter_header + string.join( chapter.title ) + chapter_inter )
+ print( '<table class="toc">' )
def toc_section_enter( self, section ):
- print ( '<tr><td class="link">'
- + '<a href="' + self.make_section_url( section ) + '">'
- + section.title + '</a></td><td class="desc">' )
- print self.make_html_para( section.abstract )
+ print( '<tr><td class="link">'
+ + '<a href="' + self.make_section_url( section ) + '">'
+ + section.title + '</a></td><td class="desc">' )
+ print( self.make_html_para( section.abstract ) )
def toc_section_exit( self, section ):
- print "</td></tr>"
+ print( "</td></tr>" )
def toc_chapter_exit( self, chapter ):
- print "</table>"
- print chapter_footer
+ print( "</table>" )
+ print( chapter_footer )
def toc_index( self, index_filename ):
print( chapter_header
@@ -583,7 +583,7 @@ class HtmlFormatter( Formatter ):
+ self.file_prefix + "index.html"
+ toc_footer_end )
- print self.html_footer
+ print( self.html_footer )
def toc_dump( self, toc_filename = None, index_filename = None ):
if toc_filename == None:
@@ -598,11 +598,11 @@ class HtmlFormatter( Formatter ):
# formatting sections
#
def section_enter( self, section ):
- print self.html_header
+ print( self.html_header )
- print ( section_title_header1 + section.name + section_title_header2
- + section.title
- + section_title_footer )
+ print( section_title_header1 + section.name + section_title_header2
+ + section.title
+ + section_title_footer )
maxwidth = 0
for b in section.blocks.values():
@@ -612,8 +612,8 @@ class HtmlFormatter( Formatter ):
width = 70 # XXX magic number
if maxwidth > 0:
# print section synopsis
- print section_synopsis_header
- print '<table class="synopsis">'
+ print( section_synopsis_header )
+ print( '<table class="synopsis">' )
columns = width // maxwidth
if columns < 1:
@@ -650,17 +650,17 @@ class HtmlFormatter( Formatter ):
line = line + '</td>'
line = line + "</tr>"
- print line
+ print( line )
- print "</table>"
- print section_synopsis_footer
+ print( "</table>" )
+ print( section_synopsis_footer )
- print description_header
- print self.make_html_items( section.description )
- print description_footer
+ print( description_header )
+ print( self.make_html_items( section.description ) )
+ print( description_footer )
def block_enter( self, block ):
- print block_header
+ print( block_header )
# place html anchor if needed
if block.name:
@@ -686,28 +686,28 @@ class HtmlFormatter( Formatter ):
# + " '" + block.source.filename + "'.\n" )
if header:
- print ( header_location_header
- + 'Defined in ' + header + '.'
- + header_location_footer )
+ print( header_location_header
+ + 'Defined in ' + header + '.'
+ + header_location_footer )
- print source_header
+ print( source_header )
for l in block.code:
- print self.html_source_quote( l, block.name )
- print source_footer
+ print( self.html_source_quote( l, block.name ) )
+ print( source_footer )
def markup_enter( self, markup, block ):
if markup.tag == "description":
- print description_header
+ print( description_header )
else:
- print marker_header + markup.tag + marker_inter
+ print( marker_header + markup.tag + marker_inter )
self.print_html_markup( markup )
def markup_exit( self, markup, block ):
if markup.tag == "description":
- print description_footer
+ print( description_footer )
else:
- print marker_footer
+ print( marker_footer )
def block_exit( self, block ):
print( block_footer_start + self.file_prefix + "index.html"
@@ -715,7 +715,7 @@ class HtmlFormatter( Formatter ):
+ block_footer_end )
def section_exit( self, section ):
- print html_footer
+ print( html_footer )
def section_dump_all( self ):
for section in self.sections:
diff --git a/modules/freetype2/src/tools/docmaker/utils.py b/modules/freetype2/src/tools/docmaker/utils.py
index cbba9b874..f40f1674a 100644
--- a/modules/freetype2/src/tools/docmaker/utils.py
+++ b/modules/freetype2/src/tools/docmaker/utils.py
@@ -3,7 +3,7 @@
#
# Auxiliary functions for the `docmaker' tool (library file).
#
-# Copyright 2002-2016 by
+# Copyright 2002-2018 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/ftfuzzer/README b/modules/freetype2/src/tools/ftfuzzer/README
index c16b7e94e..09d8e9f32 100644
--- a/modules/freetype2/src/tools/ftfuzzer/README
+++ b/modules/freetype2/src/tools/ftfuzzer/README
@@ -6,7 +6,7 @@ ftfuzzer.cc
-----------
This file contains a target function for FreeType fuzzing. It can be
-used with libFuzzer (http://llvm.org/docs/LibFuzzer.html) or
+used with libFuzzer (https://llvm.org/docs/LibFuzzer.html) or
potentially any other similar fuzzer.
Usage:
@@ -20,7 +20,7 @@ Usage:
-fsanitize=address,signed-integer-overflow,shift
You also need the header files from the `libarchive' library
- (http://www.libarchive.org/) for handling tar files (see file
+ (https://www.libarchive.org/) for handling tar files (see file
`ftmutator.cc' below for more).
2. Link with `libFuzzer' (it contains `main') and `libarchive'.
@@ -29,10 +29,14 @@ Usage:
The exact flags and commands may vary.
+ https://github.com/google/oss-fuzz/tree/master/projects/freetype2
There is a continuous fuzzing bot that runs ftfuzzer.
- https://github.com/google/libfuzzer-bot/tree/master/freetype
+ https://oss-fuzz.com
+
+(You need an account to be able to see coverage reports and the like
+on oss-fuzz.com.)
Check the bot configuration for the most current settings.
@@ -64,7 +68,7 @@ a convenience `main' function. Link it with `ftfuzzer.cc',
----------------------------------------------------------------------
-Copyright 2015-2016 by
+Copyright 2015-2018 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/ftfuzzer/ftfuzzer.cc b/modules/freetype2/src/tools/ftfuzzer/ftfuzzer.cc
index 31834a5f9..acf2bc982 100644
--- a/modules/freetype2/src/tools/ftfuzzer/ftfuzzer.cc
+++ b/modules/freetype2/src/tools/ftfuzzer/ftfuzzer.cc
@@ -2,7 +2,7 @@
//
// A fuzzing function to test FreeType with libFuzzer.
//
-// Copyright 2015-2016 by
+// Copyright 2015-2018 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
@@ -43,8 +43,7 @@
#include FT_OUTLINE_H
#include FT_BBOX_H
#include FT_MODULE_H
-#include FT_CFF_DRIVER_H
-#include FT_TRUETYPE_DRIVER_H
+#include FT_DRIVER_H
#include FT_MULTIPLE_MASTERS_H
@@ -61,7 +60,7 @@
return;
// try to activate Adobe's CFF engine; it might not be the default
- unsigned int cff_hinting_engine = FT_CFF_HINTING_ADOBE;
+ unsigned int cff_hinting_engine = FT_HINTING_ADOBE;
FT_Property_Set( library,
"cff",
"hinting-engine", &cff_hinting_engine );
@@ -76,7 +75,7 @@
FT_Global global_ft;
- // We want to select n values at random (without repitition),
+ // We want to select n values at random (without repetition),
// with 0 < n <= N. The algorithm is taken from TAoCP, Vol. 2
// (Algorithm S, selection sampling technique)
struct Random
@@ -270,11 +269,20 @@
long num_faces = face->num_faces;
FT_Done_Face( face );
- // loop over all faces
- for ( long face_index = 0;
- face_index < num_faces;
- face_index++ )
+ // loop over up to 20 arbitrarily selected faces
+ // from index range [0;num-faces-1]
+ long max_face_cnt = num_faces < 20
+ ? num_faces
+ : 20;
+
+ Random faces_pool( (int)max_face_cnt, (int)num_faces );
+
+ for ( long face_cnt = 0;
+ face_cnt < max_face_cnt;
+ face_cnt++ )
{
+ long face_index = faces_pool.get() - 1;
+
// get number of instances
if ( FT_New_Memory_Face( library,
files[0].data(),
@@ -285,17 +293,41 @@
long num_instances = face->style_flags >> 16;
FT_Done_Face( face );
- // load face with and without instances
- for ( long instance_index = 0;
- instance_index < num_instances + 1;
- instance_index++ )
+ // loop over the face without instance (index 0)
+ // and up to 20 arbitrarily selected instances
+ // from index range [1;num_instances]
+ long max_instance_cnt = num_instances < 20
+ ? num_instances
+ : 20;
+
+ Random instances_pool( (int)max_instance_cnt, (int)num_instances );
+
+ for ( long instance_cnt = 0;
+ instance_cnt <= max_instance_cnt;
+ instance_cnt++ )
{
- if ( FT_New_Memory_Face( library,
- files[0].data(),
- (FT_Long)files[0].size(),
- ( instance_index << 16 ) + face_index,
- &face ) )
- continue;
+ long instance_index = 0;
+
+ if ( !instance_cnt )
+ {
+ if ( FT_New_Memory_Face( library,
+ files[0].data(),
+ (FT_Long)files[0].size(),
+ face_index,
+ &face ) )
+ continue;
+ }
+ else
+ {
+ instance_index = instances_pool.get();
+
+ if ( FT_New_Memory_Face( library,
+ files[0].data(),
+ (FT_Long)files[0].size(),
+ ( instance_index << 16 ) + face_index,
+ &face ) )
+ continue;
+ }
// if we have more than a single input file coming from an archive,
// attach them (starting with the second file) using the order given
@@ -314,19 +346,24 @@
FT_Attach_Stream( face, &open_args );
}
- // loop over an arbitrary size for outlines (index 0)
- // and up to ten arbitrarily selected bitmap stroke sizes (index 1-10)
- int max_idx = face->num_fixed_sizes < 10
- ? face->num_fixed_sizes
- : 10;
+ // loop over an arbitrary size for outlines
+ // and up to ten arbitrarily selected bitmap strike sizes
+ // from the range [0;num_fixed_sizes - 1]
+ int max_size_cnt = face->num_fixed_sizes < 10
+ ? face->num_fixed_sizes
+ : 10;
- Random pool( max_idx, face->num_fixed_sizes );
+ Random sizes_pool( max_size_cnt, face->num_fixed_sizes );
- for ( int idx = 0; idx <= max_idx; idx++ )
+ for ( int size_cnt = 0;
+ size_cnt <= max_size_cnt;
+ size_cnt++ )
{
FT_Int32 flags = load_flags;
- if ( !idx )
+ int size_index = 0;
+
+ if ( !size_cnt )
{
// set up 20pt at 72dpi as an arbitrary size
if ( FT_Set_Char_Size( face, 20 * 64, 20 * 64, 72, 72 ) )
@@ -335,17 +372,20 @@
}
else
{
- // bitmap strokes are not active for glyph variations
+ // bitmap strikes are not active for font variations
if ( instance_index )
continue;
- if ( FT_Select_Size( face, pool.get() - 1 ) )
+ size_index = sizes_pool.get() - 1;
+
+ if ( FT_Select_Size( face, size_index ) )
continue;
flags |= FT_LOAD_COLOR;
}
// test MM interface only for a face without a selected instance
- if ( instance_index == 0 )
+ // and without a selected bitmap strike
+ if ( !instance_index && !size_cnt )
setIntermediateAxis( face );
// loop over all glyphs
diff --git a/modules/freetype2/src/tools/ftfuzzer/ftmutator.cc b/modules/freetype2/src/tools/ftfuzzer/ftmutator.cc
index 4818450aa..ae4b14040 100644
--- a/modules/freetype2/src/tools/ftfuzzer/ftmutator.cc
+++ b/modules/freetype2/src/tools/ftfuzzer/ftmutator.cc
@@ -2,7 +2,7 @@
//
// A custom fuzzer mutator to test for FreeType with libFuzzer.
//
-// Copyright 2015-2016 by
+// Copyright 2015-2018 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/ftfuzzer/rasterfuzzer.cc b/modules/freetype2/src/tools/ftfuzzer/rasterfuzzer.cc
index 05187b0be..c69b95ea0 100644
--- a/modules/freetype2/src/tools/ftfuzzer/rasterfuzzer.cc
+++ b/modules/freetype2/src/tools/ftfuzzer/rasterfuzzer.cc
@@ -2,7 +2,7 @@
//
// A fuzzing function to test FreeType's rasterizers with libFuzzer.
//
-// Copyright 2016 by
+// Copyright 2016-2018 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/ftfuzzer/runinput.cc b/modules/freetype2/src/tools/ftfuzzer/runinput.cc
index d5f9f1587..2b02f5758 100644
--- a/modules/freetype2/src/tools/ftfuzzer/runinput.cc
+++ b/modules/freetype2/src/tools/ftfuzzer/runinput.cc
@@ -2,7 +2,7 @@
//
// A `main' function for fuzzers like `ftfuzzer.cc'.
//
-// Copyright 2015-2016 by
+// Copyright 2015-2018 by
// David Turner, Robert Wilhelm, and Werner Lemberg.
//
// This file is part of the FreeType project, and may only be used,
diff --git a/modules/freetype2/src/tools/glnames.py b/modules/freetype2/src/tools/glnames.py
index 3569f06ee..b048d2936 100644
--- a/modules/freetype2/src/tools/glnames.py
+++ b/modules/freetype2/src/tools/glnames.py
@@ -6,7 +6,7 @@
#
-# Copyright 1996-2016 by
+# Copyright 1996-2018 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
@@ -151,7 +151,7 @@ mac_standard_names = \
# The list of standard `SID' glyph names. For the official list,
# see Annex A of document at
#
-# http://partners.adobe.com/public/developer/en/font/5176.CFF.pdf .
+# https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5176.CFF.pdf .
#
sid_standard_names = \
[
@@ -4920,7 +4920,7 @@ class StringTable:
def dump( self, file ):
write = file.write
- write( "#ifndef DEFINE_PS_TABLES\n" )
+ write( "#ifndef DEFINE_PS_TABLES_DATA\n" )
write( "#ifdef __cplusplus\n" )
write( ' extern "C"\n' )
write( "#else\n" )
@@ -4929,7 +4929,7 @@ class StringTable:
write( "#endif\n" )
write( " const char " + self.master_table +
"[" + repr( self.total ) + "]\n" )
- write( "#ifdef DEFINE_PS_TABLES\n" )
+ write( "#ifdef DEFINE_PS_TABLES_DATA\n" )
write( " =\n" )
write( " {\n" )
@@ -4941,7 +4941,7 @@ class StringTable:
write( line )
write( " }\n" )
- write( "#endif /* DEFINE_PS_TABLES */\n" )
+ write( "#endif /* DEFINE_PS_TABLES_DATA */\n" )
write( " ;\n\n\n" )
def dump_sublist( self, file, table_name, macro_name, sublist ):
@@ -4950,7 +4950,7 @@ class StringTable:
write( " /* Values are offsets into the `" +
self.master_table + "' table */\n\n" )
- write( "#ifndef DEFINE_PS_TABLES\n" )
+ write( "#ifndef DEFINE_PS_TABLES_DATA\n" )
write( "#ifdef __cplusplus\n" )
write( ' extern "C"\n' )
write( "#else\n" )
@@ -4959,7 +4959,7 @@ class StringTable:
write( "#endif\n" )
write( " const short " + table_name +
"[" + macro_name + "]\n" )
- write( "#ifdef DEFINE_PS_TABLES\n" )
+ write( "#ifdef DEFINE_PS_TABLES_DATA\n" )
write( " =\n" )
write( " {\n" )
@@ -4979,7 +4979,7 @@ class StringTable:
write( line )
write( "\n" )
write( " }\n" )
- write( "#endif /* DEFINE_PS_TABLES */\n" )
+ write( "#endif /* DEFINE_PS_TABLES_DATA */\n" )
write( " ;\n\n\n" )
@@ -5213,7 +5213,7 @@ def dump_encoding( file, encoding_name, encoding_list ):
write = file.write
write( " /* the following are indices into the SID name table */\n" )
- write( "#ifndef DEFINE_PS_TABLES\n" )
+ write( "#ifndef DEFINE_PS_TABLES_DATA\n" )
write( "#ifdef __cplusplus\n" )
write( ' extern "C"\n' )
write( "#else\n" )
@@ -5222,7 +5222,7 @@ def dump_encoding( file, encoding_name, encoding_list ):
write( "#endif\n" )
write( " const unsigned short " + encoding_name +
"[" + repr( len( encoding_list ) ) + "]\n" )
- write( "#ifdef DEFINE_PS_TABLES\n" )
+ write( "#ifdef DEFINE_PS_TABLES_DATA\n" )
write( " =\n" )
write( " {\n" )
@@ -5241,14 +5241,14 @@ def dump_encoding( file, encoding_name, encoding_list ):
write( line )
write( "\n" )
write( " }\n" )
- write( "#endif /* DEFINE_PS_TABLES */\n" )
+ write( "#endif /* DEFINE_PS_TABLES_DATA */\n" )
write( " ;\n\n\n" )
def dump_array( the_array, write, array_name ):
"""dumps a given encoding"""
- write( "#ifndef DEFINE_PS_TABLES\n" )
+ write( "#ifndef DEFINE_PS_TABLES_DATA\n" )
write( "#ifdef __cplusplus\n" )
write( ' extern "C"\n' )
write( "#else\n" )
@@ -5257,7 +5257,7 @@ def dump_array( the_array, write, array_name ):
write( "#endif\n" )
write( " const unsigned char " + array_name +
"[" + repr( len( the_array ) ) + "L]\n" )
- write( "#ifdef DEFINE_PS_TABLES\n" )
+ write( "#ifdef DEFINE_PS_TABLES_DATA\n" )
write( " =\n" )
write( " {\n" )
@@ -5282,7 +5282,7 @@ def dump_array( the_array, write, array_name ):
write( line )
write( "\n" )
write( " }\n" )
- write( "#endif /* DEFINE_PS_TABLES */\n" )
+ write( "#endif /* DEFINE_PS_TABLES_DATA */\n" )
write( " ;\n\n\n" )
@@ -5293,7 +5293,7 @@ def main():
print __doc__ % sys.argv[0]
sys.exit( 1 )
- file = open( sys.argv[1], "w\n" )
+ file = open( sys.argv[1], "wb" )
write = file.write
count_sid = len( sid_standard_names )
@@ -5318,7 +5318,7 @@ def main():
write( "/* */\n" )
write( "/* PostScript glyph names. */\n" )
write( "/* */\n" )
- write( "/* Copyright 2005-2016 by */\n" )
+ write( "/* Copyright 2005-2018 by */\n" )
write( "/* David Turner, Robert Wilhelm, and Werner Lemberg. */\n" )
write( "/* */\n" )
write( "/* This file is part of the FreeType project, and may only be used, */\n" )
@@ -5378,6 +5378,7 @@ def main():
# write the lookup routine now
#
write( """\
+#ifdef DEFINE_PS_TABLES
/*
* This function searches the compressed table efficiently.
*/
@@ -5472,6 +5473,7 @@ def main():
NotFound:
return 0;
}
+#endif /* DEFINE_PS_TABLES */
#endif /* FT_CONFIG_OPTION_ADOBE_GLYPH_LIST */
diff --git a/modules/freetype2/src/tools/update-copyright-year b/modules/freetype2/src/tools/update-copyright-year
index f4a323b7c..934f11cf0 100755
--- a/modules/freetype2/src/tools/update-copyright-year
+++ b/modules/freetype2/src/tools/update-copyright-year
@@ -2,7 +2,7 @@ eval '(exit $?0)' && eval 'exec perl -wS -i "$0" ${1+"$@"}'
& eval 'exec perl -wS -i "$0" $argv:q'
if 0;
-# Copyright 2015-2016 by
+# Copyright 2015-2018 by
# Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,