<commit_before>diff -ruN matplotlib-1.4.3/setupext.py matplotlib-1.4.3-new/setupext.py
--- matplotlib-1.4.3/setupext.py	2015-02-15 20:46:36.000000000 -0700
+++ matplotlib-1.4.3-new/setupext.py	2015-07-05 10:42:02.531276300 -0600
@@ -942,7 +942,12 @@
 
     def check(self):
         if sys.platform == 'win32':
-            check_include_file(get_include_dirs(), 'ft2build.h', 'freetype')
+            incdirs = get_include_dirs()
+            for d in get_base_dirs():
+              incdirs.append(os.path.join(d, 'include\\freetype2'))
+            print_message("Potential incdirs are %s" %
+              ', '.join(`x` for x in incdirs))
+            check_include_file(incdirs, 'ft2build.h', 'freetype')
             return 'Using unknown version found on system.'
 
         status, output = getstatusoutput("freetype-config --ftversion")
@@ -956,8 +961,14 @@
         if version is None or 'No such file or directory\ngrep:' in version:
             version = self.version_from_header()
 
+        try:
+          return self._check_for_pkg_config(
+            'freetype', 'ft2build.h',
+            min_version='2.3', version=version)
+        except: pass
+
         return self._check_for_pkg_config(
-            'freetype2', 'ft2build.h',
+            'freetype', 'freetype2/ft2build.h',
             min_version='2.3', version=version)
 
     def version_from_header(self):
diff -ruN matplotlib-1.4.3/src/_path.cpp matplotlib-1.4.3-new/src/_path.cpp
--- matplotlib-1.4.3/src/_path.cpp	2015-02-15 20:46:36.000000000 -0700
+++ matplotlib-1.4.3-new/src/_path.cpp	2015-07-05 10:42:21.126357100 -0600
@@ -4,6 +4,7 @@
 #include "agg_py_transforms.h"
 #include "path_converters.h"
 
+#include <algorithm>
 #include <limits>
 #include <math.h>
 
diff -ruN matplotlib-1.4.3/src/ft2font.cpp matplotlib-1.4.3-new/src/ft2font.cpp
--- matplotlib-1.4.3/src/ft2font.cpp	2015-02-15 20:46:36.000000000 -0700
+++ matplotlib-1.4.3-new/src/ft2font.cpp	2015-07-05 10:42:27.803114300 -0600
@@ -3,6 +3,7 @@
 #include "ft2font.h"
 #include "mplutils.h"
 #include <sstream>
+#include <algorithm>
 
 #include "file_compat.h"
 <commit_msg>Fixed font problem.<commit_after>diff -ruN matplotlib-1.4.3/lib/matplotlib/texmanager.py matplotlib-1.4.3-new/lib/matplotlib/texmanager.py
--- matplotlib-1.4.3/lib/matplotlib/texmanager.py	2015-02-15 19:46:36.000000000 -0800
+++ matplotlib-1.4.3-new/lib/matplotlib/texmanager.py	2015-08-29 11:45:28.273498184 -0700
@@ -213,8 +213,7 @@
         while '\\usepackage{type1cm}' in cmd:
             cmd.remove('\\usepackage{type1cm}')
         cmd = '\n'.join(cmd)
-        self._font_preamble = '\n'.join(['\\usepackage{type1cm}', cmd,
-                                         '\\usepackage{textcomp}'])
+        self._font_preamble = '\n'.join(['\\usepackage{type1cm}', cmd])
 
     def get_basefile(self, tex, fontsize, dpi=None):
         """
diff -ruN matplotlib-1.4.3/setupext.py matplotlib-1.4.3-new/setupext.py
--- matplotlib-1.4.3/setupext.py	2015-02-15 19:46:36.000000000 -0800
+++ matplotlib-1.4.3-new/setupext.py	2015-08-29 11:41:56.353841376 -0700
@@ -942,7 +942,12 @@
 
     def check(self):
         if sys.platform == 'win32':
-            check_include_file(get_include_dirs(), 'ft2build.h', 'freetype')
+            incdirs = get_include_dirs()
+            for d in get_base_dirs():
+              incdirs.append(os.path.join(d, 'include\\freetype2'))
+            print_message("Potential incdirs are %s" %
+              ', '.join(`x` for x in incdirs))
+            check_include_file(incdirs, 'ft2build.h', 'freetype')
             return 'Using unknown version found on system.'
 
         status, output = getstatusoutput("freetype-config --ftversion")
@@ -956,8 +961,14 @@
         if version is None or 'No such file or directory\ngrep:' in version:
             version = self.version_from_header()
 
+        try:
+          return self._check_for_pkg_config(
+            'freetype', 'ft2build.h',
+            min_version='2.3', version=version)
+        except: pass
+
         return self._check_for_pkg_config(
-            'freetype2', 'ft2build.h',
+            'freetype', 'freetype2/ft2build.h',
             min_version='2.3', version=version)
 
     def version_from_header(self):
diff -ruN matplotlib-1.4.3/src/ft2font.cpp matplotlib-1.4.3-new/src/ft2font.cpp
--- matplotlib-1.4.3/src/ft2font.cpp	2015-02-15 19:46:36.000000000 -0800
+++ matplotlib-1.4.3-new/src/ft2font.cpp	2015-08-29 11:41:56.358088831 -0700
@@ -3,6 +3,7 @@
 #include "ft2font.h"
 #include "mplutils.h"
 #include <sstream>
+#include <algorithm>
 
 #include "file_compat.h"
 
diff -ruN matplotlib-1.4.3/src/_path.cpp matplotlib-1.4.3-new/src/_path.cpp
--- matplotlib-1.4.3/src/_path.cpp	2015-02-15 19:46:36.000000000 -0800
+++ matplotlib-1.4.3-new/src/_path.cpp	2015-08-29 11:41:56.356173581 -0700
@@ -4,6 +4,7 @@
 #include "agg_py_transforms.h"
 #include "path_converters.h"
 
+#include <algorithm>
 #include <limits>
 #include <math.h>
 
{'fraction_non_alphanumeric': 0.16636491651579158, 'fraction_numerical': 0.11345805672902837, 'mean_word_length': 2.6639646278555635, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 7, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7634893', 'n_tokens_mistral': 2243, 'n_tokens_neox': 1934, 'n_words': 307}