summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Behrendt2016-02-16 19:04:07 +0100
committerMarcus Behrendt2016-02-16 19:04:07 +0100
commitba3f69dc8c2314c58260f62a17bf30f84180e3f4 (patch)
tree775e4859f33599f0a7c97085c489923e619f3d74
parent75e0367bc0eea37d2a5037fb5b5d66ab22119a37 (diff)
downloadaur-ba3f69dc8c2314c58260f62a17bf30f84180e3f4.tar.gz
use bohoomil's git repo in order to update pkg
-rw-r--r--.SRCINFO53
-rw-r--r--01-freetype-2.6.2-enable-valid.patch (renamed from 01-freetype-2.6-enable-valid.patch)0
-rw-r--r--02-upstream-2015.08.24.patch.xzbin231920 -> 0 bytes
-rw-r--r--02-upstream-2015.12.05.patch1098
-rw-r--r--03-infinality-2.6.2-2015.12.05.patch (renamed from 03-infinality-2.6-2015.08.24.patch)4284
-rw-r--r--CHANGELOG316
-rw-r--r--PKGBUILD119
-rw-r--r--infinality-settings-generic1137
-rwxr-xr-xinfinality-settings.sh102
-rw-r--r--infinality.install18
-rw-r--r--install.sh11
-rwxr-xr-xxft-settings.sh15
12 files changed, 5419 insertions, 1734 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c7da5ca6521..b6b8fe927d3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,30 +1,43 @@
-pkgbase = freetype2-infinality
- pkgdesc = TrueType font rendering library with infinality patch
- pkgver = 2.6
- pkgrel = 2
- url = https://github.com/bohoomil/fontconfig-ultimate
- install = install.sh
+# Generated by mksrcinfo v8
+# Tue Feb 16 18:03:44 UTC 2016
+pkgbase = freetype2-infinality-ultimate
+ pkgdesc = TrueType font rendering library with Infinality patches and custom settings.
+ pkgver = 2.6.2
+ pkgrel = 1
+ url = http://freetype.sourceforge.net
+ install = infinality.install
+ changelog = CHANGELOG
+ arch = armv7h
arch = i686
arch = x86_64
+ groups = infinality-bundle
license = GPL
+ license = MIT
depends = zlib
depends = bzip2
depends = sh
- optdepends = fontconfig-infinality: Infinality package for fontconfig (required)
- provides = freetype2=2.6
+ depends = xorg-xrdb
+ depends = libpng
+ depends = harfbuzz
+ provides = freetype2=2.6.2
+ provides = freetype2-infinality
+ provides = freetype2-infinality-ultimate
conflicts = freetype2
- options = !libtool
- backup = etc/profile.d/infinality-settings.sh
- source = http://downloads.sourceforge.net/sourceforge/freetype/freetype-2.6.tar.bz2
+ conflicts = freetype2-infinality
+ source = http://downloads.sourceforge.net/sourceforge/freetype/freetype-2.6.2.tar.bz2
+ source = 01-freetype-2.6.2-enable-valid.patch
+ source = 02-upstream-2015.12.05.patch
+ source = 03-infinality-2.6.2-2015.12.05.patch
+ source = xft-settings.sh
source = infinality-settings.sh
- source = 01-freetype-2.6-enable-valid.patch
- source = 02-upstream-2015.08.24.patch.xz
- source = 03-infinality-2.6-2015.08.24.patch
- sha256sums = 8469fb8124764f85029cc8247c31e132a2c5e51084ddce2a44ea32ee4ae8347e
- sha256sums = 21192ce47be46ccd44e8aeea99754d4e5e38cb52717f752d67c319c74fea2716
- sha256sums = 086c9874ba5217dab419ac03dbc5ad6480aaa67b3c9d802f7181d8a3e007f8eb
- sha256sums = 62eaa124f09916e237be994890178fb041b3648223f08429566df3a962971d8a
- sha256sums = 241de84ca25d7ff106a3ebd5121d12a315abe5a72771957bd674e8b2e41c97d2
+ source = infinality-settings-generic
+ sha1sums = 29c22b85b77cb22cf95c13e7062e21f39fe6b17a
+ sha1sums = abf7a8f726ad6359533651a8942636880febf9f6
+ sha1sums = 319c377ef4e3f6bc2f52acb893c9b880ef9578b4
+ sha1sums = a19a000e778a0b29b0ef0623d566b12187b7f24a
+ sha1sums = a1859f2eacae2046a9ef705ac2bcc4bdf4fd9717
+ sha1sums = 5624c40049a73f8c75d01537212b4c7040f1761f
+ sha1sums = 4d219670cb9641b649f6ba0f2a799006f7c3c3c5
-pkgname = freetype2-infinality
+pkgname = freetype2-infinality-ultimate
diff --git a/01-freetype-2.6-enable-valid.patch b/01-freetype-2.6.2-enable-valid.patch
index df81058b16d..df81058b16d 100644
--- a/01-freetype-2.6-enable-valid.patch
+++ b/01-freetype-2.6.2-enable-valid.patch
diff --git a/02-upstream-2015.08.24.patch.xz b/02-upstream-2015.08.24.patch.xz
deleted file mode 100644
index 4d2493b9eb0..00000000000
--- a/02-upstream-2015.08.24.patch.xz
+++ /dev/null
Binary files differ
diff --git a/02-upstream-2015.12.05.patch b/02-upstream-2015.12.05.patch
new file mode 100644
index 00000000000..d75206e149a
--- /dev/null
+++ b/02-upstream-2015.12.05.patch
@@ -0,0 +1,1098 @@
+From f8c20577897d17fb8a62e64fa3bf3ebec0691608 Mon Sep 17 00:00:00 2001
+From: Alexei Podtelezhnikov <apodtele@gmail.com>
+Date: Sat, 28 Nov 2015 22:43:33 -0500
+Subject: [PATCH 2/2] * include/freetype/ftlcdfil.h: Documentation tweak.
+
+---
+ ChangeLog | 4 ++++
+ include/freetype/ftlcdfil.h | 5 ++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 31c2ac9..9133021 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2015-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
++
++ * include/freetype/ftlcdfil.h: Documentation tweak.
++
+ 2015-11-28 Werner Lemberg <wl@gnu.org>
+
+ * Version 2.6.2 released.
+diff --git a/include/freetype/ftlcdfil.h b/include/freetype/ftlcdfil.h
+index 653ed36..a9dd3ea 100644
+--- a/include/freetype/ftlcdfil.h
++++ b/include/freetype/ftlcdfil.h
+@@ -250,9 +250,8 @@ FT_BEGIN_HEADER
+ * @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.
++ * (0x00, 0x55, 0x56, 0x55, 0x00) for FT_LCD_FILTER_LIGHT, and (0x08,
++ * 0x4D, 0x56, 0x4D, 0x08) for FT_LCD_FILTER_DEFAULT.
+ *
+ * @input:
+ * library ::
+--
+2.6.2
+From 5b05bc6638df2cac9622f03338253a720604d1be Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Tue, 1 Dec 2015 12:09:02 +0100
+Subject: [PATCH 1/7] [type1] Avoid dangling pointer (#46572).
+
+* src/type1/t1afm.c (T1_Read_Metrics): Properly reset
+`face->afm_data'.
+---
+ ChangeLog | 7 +++++++
+ src/type1/t1afm.c | 2 ++
+ 2 files changed, 9 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index 9133021..a9ce090 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,10 @@
++2015-12-01 Werner Lemberg <wl@gnu.org>
++
++ [type1] Avoid dangling pointer (#46572).
++
++ * src/type1/t1afm.c (T1_Read_Metrics): Properly reset
++ `face->afm_data'.
++
+ 2015-11-28 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ * include/freetype/ftlcdfil.h: Documentation tweak.
+diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
+index 7a7bf82..883a740 100644
+--- a/src/type1/t1afm.c
++++ b/src/type1/t1afm.c
+@@ -248,6 +248,8 @@
+ FT_TRACE1(( "T1_Read_Metrics:"
+ " Freeing previously attached metrics data.\n" ));
+ T1_Done_Metrics( memory, (AFM_FontInfo)face->afm_data );
++
++ face->afm_data = NULL;
+ }
+
+ if ( FT_NEW( fi ) ||
+--
+2.6.3
+
+From 1b740a00761f5f14200d6d60cec8fa416b2fcbde Mon Sep 17 00:00:00 2001
+From: Alexei Podtelezhnikov <apodtele@gmail.com>
+Date: Wed, 2 Dec 2015 00:30:57 -0500
+Subject: [PATCH 2/7] Minor rearrangement.
+
+---
+ include/freetype/freetype.h | 32 ++++++++++++++++----------------
+ 1 file changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
+index 41379ea..f68718d 100644
+--- a/include/freetype/freetype.h
++++ b/include/freetype/freetype.h
+@@ -3015,6 +3015,22 @@ FT_BEGIN_HEADER
+ /* the glyph image format, finding the relevant renderer, and */
+ /* invoking it. */
+ /* */
++ /* <InOut> */
++ /* slot :: A handle to the glyph slot containing the image to */
++ /* 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. */
++ /* */
++ /* <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. */
++ /* */
+ /* 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 */
+@@ -3092,22 +3108,6 @@ FT_BEGIN_HEADER
+ /* linear blending is done 3~times per pixel: red foreground subpixel */
+ /* to red background subpixel and so on for green and blue. */
+ /* */
+- /* <InOut> */
+- /* slot :: A handle to the glyph slot containing the image to */
+- /* 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. */
+- /* */
+- /* <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. */
+- /* */
+ FT_EXPORT( FT_Error )
+ FT_Render_Glyph( FT_GlyphSlot slot,
+ FT_Render_Mode render_mode );
+--
+2.6.3
+
+From a415473820fcbf365040cecb1ac2a382c41e825d Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Thu, 3 Dec 2015 07:49:46 +0100
+Subject: [PATCH 3/7] * builds/unix/install.mk (install): Remove stale
+ `ft2build.h'.
+
+---
+ ChangeLog | 4 ++++
+ builds/unix/install.mk | 3 +++
+ 2 files changed, 7 insertions(+)
+
+diff --git a/ChangeLog b/ChangeLog
+index a9ce090..64cfbc1 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2015-12-03 Werner Lemberg <wl@gnu.org>
++
++ * builds/unix/install.mk (install): Remove stale `ft2build.h'.
++
+ 2015-12-01 Werner Lemberg <wl@gnu.org>
+
+ [type1] Avoid dangling pointer (#46572).
+diff --git a/builds/unix/install.mk b/builds/unix/install.mk
+index c7a20a3..fbe2d81 100644
+--- a/builds/unix/install.mk
++++ b/builds/unix/install.mk
+@@ -28,8 +28,11 @@
+ # installing new files to avoid interferences with files installed by
+ # previous FreeType versions (which use slightly different locations).
+ #
++# We also remove `$(includedir)/ft2build.h' for the same reason.
++#
+ install: $(PROJECT_LIBRARY)
+ -$(DELDIR) $(DESTDIR)$(includedir)/freetype2
++ -$(DELETE) $(DESTDIR)$(includedir)/ft2build.h
+ $(MKINSTALLDIRS) $(DESTDIR)$(libdir) \
+ $(DESTDIR)$(libdir)/pkgconfig \
+ $(DESTDIR)$(includedir)/freetype2/freetype/config \
+--
+2.6.3
+
+From 53696f03ce1c0e572609d375a44b348bb6097d30 Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Sat, 5 Dec 2015 07:44:16 +0100
+Subject: [PATCH 4/7] * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/.
+
+---
+ ChangeLog | 4 ++++
+ src/autofit/afwarp.c | 2 +-
+ 2 files changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 64cfbc1..51d951a 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,3 +1,7 @@
++2015-12-05 Werner Lemberg <wl@gnu.org>
++
++ * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/.
++
+ 2015-12-03 Werner Lemberg <wl@gnu.org>
+
+ * builds/unix/install.mk (install): Remove stale `ft2build.h'.
+diff --git a/src/autofit/afwarp.c b/src/autofit/afwarp.c
+index 59af4f0..ae92db1 100644
+--- a/src/autofit/afwarp.c
++++ b/src/autofit/afwarp.c
+@@ -193,7 +193,7 @@
+
+ warper->best_scale = org_scale;
+ warper->best_delta = org_delta;
+- warper->best_score = INT_MIN;
++ warper->best_score = FT_INT_MIN;
+ warper->best_distort = 0;
+
+ axis = &hints->axis[dim];
+--
+2.6.3
+
+From f7e6d51a75fb07685f64d16985363a3b2d79b52f Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Sat, 5 Dec 2015 13:08:45 +0100
+Subject: [PATCH 5/7] * src/autofit/afblue.hin (GET_UTF8_CHAR): Use
+ `do...while(0)'.
+
+* src/autofit/afblue.h: Regenerated.
+---
+ ChangeLog | 6 ++++++
+ src/autofit/afblue.h | 55 ++++++++++++++++++++++++++------------------------
+ src/autofit/afblue.hin | 55 ++++++++++++++++++++++++++------------------------
+ 3 files changed, 64 insertions(+), 52 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 51d951a..7446c25 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,11 @@
+ 2015-12-05 Werner Lemberg <wl@gnu.org>
+
++ * src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'.
++
++ * src/autofit/afblue.h: Regenerated.
++
++2015-12-05 Werner Lemberg <wl@gnu.org>
++
+ * src/autofit/afwarp.c: s/INT_MIN/FT_INT_MIN/.
+
+ 2015-12-03 Werner Lemberg <wl@gnu.org>
+diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h
+index c26a9c7..a79098a 100644
+--- a/src/autofit/afblue.h
++++ b/src/autofit/afblue.h
+@@ -28,32 +28,35 @@ FT_BEGIN_HEADER
+
+ /* an auxiliary macro to decode a UTF-8 character -- since we only use */
+ /* hard-coded, self-converted data, no error checking is performed */
+-#define GET_UTF8_CHAR( ch, p ) \
+- ch = (unsigned char)*p++; \
+- if ( ch >= 0x80 ) \
+- { \
+- FT_UInt len; \
+- \
+- \
+- if ( ch < 0xE0 ) \
+- { \
+- len = 1; \
+- ch &= 0x1F; \
+- } \
+- else if ( ch < 0xF0 ) \
+- { \
+- len = 2; \
+- ch &= 0x0F; \
+- } \
+- else \
+- { \
+- len = 3; \
+- ch &= 0x07; \
+- } \
+- \
+- for ( ; len > 0; len-- ) \
+- ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
+- }
++#define GET_UTF8_CHAR( ch, p ) \
++ do \
++ { \
++ ch = (unsigned char)*p++; \
++ if ( ch >= 0x80 ) \
++ { \
++ FT_UInt len_; \
++ \
++ \
++ if ( ch < 0xE0 ) \
++ { \
++ len_ = 1; \
++ ch &= 0x1F; \
++ } \
++ else if ( ch < 0xF0 ) \
++ { \
++ len_ = 2; \
++ ch &= 0x0F; \
++ } \
++ else \
++ { \
++ len_ = 3; \
++ ch &= 0x07; \
++ } \
++ \
++ for ( ; len_ > 0; len_-- ) \
++ ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
++ } \
++ } while ( 0 )
+
+
+ /*************************************************************************/
+diff --git a/src/autofit/afblue.hin b/src/autofit/afblue.hin
+index ad43fe6..3f85ee7 100644
+--- a/src/autofit/afblue.hin
++++ b/src/autofit/afblue.hin
+@@ -25,32 +25,35 @@ FT_BEGIN_HEADER
+
+ /* an auxiliary macro to decode a UTF-8 character -- since we only use */
+ /* hard-coded, self-converted data, no error checking is performed */
+-#define GET_UTF8_CHAR( ch, p ) \
+- ch = (unsigned char)*p++; \
+- if ( ch >= 0x80 ) \
+- { \
+- FT_UInt len; \
+- \
+- \
+- if ( ch < 0xE0 ) \
+- { \
+- len = 1; \
+- ch &= 0x1F; \
+- } \
+- else if ( ch < 0xF0 ) \
+- { \
+- len = 2; \
+- ch &= 0x0F; \
+- } \
+- else \
+- { \
+- len = 3; \
+- ch &= 0x07; \
+- } \
+- \
+- for ( ; len > 0; len-- ) \
+- ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
+- }
++#define GET_UTF8_CHAR( ch, p ) \
++ do \
++ { \
++ ch = (unsigned char)*p++; \
++ if ( ch >= 0x80 ) \
++ { \
++ FT_UInt len_; \
++ \
++ \
++ if ( ch < 0xE0 ) \
++ { \
++ len_ = 1; \
++ ch &= 0x1F; \
++ } \
++ else if ( ch < 0xF0 ) \
++ { \
++ len_ = 2; \
++ ch &= 0x0F; \
++ } \
++ else \
++ { \
++ len_ = 3; \
++ ch &= 0x07; \
++ } \
++ \
++ for ( ; len_ > 0; len_-- ) \
++ ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
++ } \
++ } while ( 0 )
+
+
+ /*************************************************************************/
+--
+2.6.3
+
+From 453722db8e0e7319c35a40eb592d7ead7d6d0211 Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Sat, 5 Dec 2015 13:20:30 +0100
+Subject: [PATCH 6/7] * src/tools/afblue.pl (convert_ascii_chars): Don't ignore
+ spaces.
+
+Instead, reduce multiple spaces to a single one. We need this later
+for supporting character clusters in `afblue.dat'.
+---
+ ChangeLog | 7 +++++++
+ src/tools/afblue.pl | 15 +++++++++------
+ 2 files changed, 16 insertions(+), 6 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index 7446c25..b1801a8 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,12 @@
+ 2015-12-05 Werner Lemberg <wl@gnu.org>
+
++ * src/tools/afblue.pl (convert_ascii_chars): Don't ignore spaces.
++
++ Instead, reduce multiple spaces to a single one. We need this later
++ for supporting character clusters in `afblue.dat'.
++
++2015-12-05 Werner Lemberg <wl@gnu.org>
++
+ * src/autofit/afblue.hin (GET_UTF8_CHAR): Use `do...while(0)'.
+
+ * src/autofit/afblue.h: Regenerated.
+diff --git a/src/tools/afblue.pl b/src/tools/afblue.pl
+index 56b6452..a9c11b2 100644
+--- a/src/tools/afblue.pl
++++ b/src/tools/afblue.pl
+@@ -38,7 +38,8 @@ my $curr_max; # Name of the current maximum value.
+
+ my $curr_enum_element; # Name of the current enumeration element.
+ my $curr_offset; # The offset relative to current aux. variable.
+-my $curr_elem_size; # The size of the current string or block.
++my $curr_elem_size; # The number of non-space characters in the current string or
++ # the number of elements in the current block.
+
+ my $have_sections = 0; # Boolean; set if start of a section has been seen.
+ my $have_strings; # Boolean; set if current section contains strings.
+@@ -159,12 +160,14 @@ sub convert_ascii_chars
+ # A series of ASCII characters in the printable range.
+ my $s = shift;
+
+- # We ignore spaces.
+- $s =~ s/ //g;
++ # We reduce multiple space characters to a single one.
++ $s =~ s/ +/ /g;
+
+- my $count = $s =~ s/\G(.)/'$1', /g;
+- $curr_offset += $count;
+- $curr_elem_size += $count;
++ # Count all non-space characters. Note that `()' applies a list context
++ # to the capture that is used to count the elements.
++ $curr_elem_size += () = $s =~ /[^ ]/g;
++
++ $curr_offset += $s =~ s/\G(.)/'$1', /g;
+
+ return $s;
+ }
+--
+2.6.3
+
+From a8a54c30603ddedef5a2a96615e9fd66504356bf Mon Sep 17 00:00:00 2001
+From: Werner Lemberg <wl@gnu.org>
+Date: Sat, 5 Dec 2015 13:26:44 +0100
+Subject: [PATCH 7/7] * src/autofit/afblue.dat: Separate blue zone characters
+ with spaces.
+
+Another preparation for character cluster support.
+
+* src/autofit/afblue.c, src/autofit.afblue.h: Regenerated.
+---
+ ChangeLog | 8 +++
+ src/autofit/afblue.c | 162 ++++++++++++++++++++++++------------------------
+ src/autofit/afblue.dat | 163 +++++++++++++++++++++++++------------------------
+ src/autofit/afblue.h | 104 +++++++++++++++----------------
+ 4 files changed, 224 insertions(+), 213 deletions(-)
+
+diff --git a/ChangeLog b/ChangeLog
+index b1801a8..d696e8a 100644
+--- a/ChangeLog
++++ b/ChangeLog
+@@ -1,5 +1,13 @@
+ 2015-12-05 Werner Lemberg <wl@gnu.org>
+
++ * src/autofit/afblue.dat: Separate blue zone characters with spaces.
++
++ Another preparation for character cluster support.
++
++ * src/autofit/afblue.c, src/autofit.afblue.h: Regenerated.
++
++2015-12-05 Werner Lemberg <wl@gnu.org>
++
+ * src/tools/afblue.pl (convert_ascii_chars): Don't ignore spaces.
+
+ Instead, reduce multiple spaces to a single one. We need this later
+diff --git a/src/autofit/afblue.c b/src/autofit/afblue.c
+index b871e0c..f528908 100644
+--- a/src/autofit/afblue.c
++++ b/src/autofit/afblue.c
+@@ -26,139 +26,139 @@
+ af_blue_strings[] =
+ {
+ /* */
+- '\xD8', '\xA7', '\xD8', '\xA5', '\xD9', '\x84', '\xD9', '\x83', '\xD8', '\xB7', '\xD8', '\xB8', /* ا إ ل ك ط ظ */
++ '\xD8', '\xA7', ' ', '\xD8', '\xA5', ' ', '\xD9', '\x84', ' ', '\xD9', '\x83', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', /* ا إ ل ك ط ظ */
+ '\0',
+- '\xD8', '\xAA', '\xD8', '\xAB', '\xD8', '\xB7', '\xD8', '\xB8', '\xD9', '\x83', /* ت ث ط ظ ك */
++ '\xD8', '\xAA', ' ', '\xD8', '\xAB', ' ', '\xD8', '\xB7', ' ', '\xD8', '\xB8', ' ', '\xD9', '\x83', /* ت ث ط ظ ك */
+ '\0',
+ '\xD9', '\x80', /* ـ */
+ '\0',
+- '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\x9F', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕПЗОСЭ */
++ '\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\x9F', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е П З О С Э */
+ '\0',
+- '\xD0', '\x91', '\xD0', '\x92', '\xD0', '\x95', '\xD0', '\xA8', '\xD0', '\x97', '\xD0', '\x9E', '\xD0', '\xA1', '\xD0', '\xAD', /* БВЕШЗОСЭ */
++ '\xD0', '\x91', ' ', '\xD0', '\x92', ' ', '\xD0', '\x95', ' ', '\xD0', '\xA8', ' ', '\xD0', '\x97', ' ', '\xD0', '\x9E', ' ', '\xD0', '\xA1', ' ', '\xD0', '\xAD', /* Б В Е Ш З О С Э */
+ '\0',
+- '\xD1', '\x85', '\xD0', '\xBF', '\xD0', '\xBD', '\xD1', '\x88', '\xD0', '\xB5', '\xD0', '\xB7', '\xD0', '\xBE', '\xD1', '\x81', /* хпншезос */
++ '\xD1', '\x85', ' ', '\xD0', '\xBF', ' ', '\xD0', '\xBD', ' ', '\xD1', '\x88', ' ', '\xD0', '\xB5', ' ', '\xD0', '\xB7', ' ', '\xD0', '\xBE', ' ', '\xD1', '\x81', /* х п н ш е з о с */
+ '\0',
+- '\xD1', '\x80', '\xD1', '\x83', '\xD1', '\x84', /* руф */
++ '\xD1', '\x80', ' ', '\xD1', '\x83', ' ', '\xD1', '\x84', /* р у ф */
+ '\0',
+- '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
++ '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
+ '\0',
+- '\xE0', '\xA4', '\x88', '\xE0', '\xA4', '\x90', '\xE0', '\xA4', '\x93', '\xE0', '\xA4', '\x94', '\xE0', '\xA4', '\xBF', '\xE0', '\xA5', '\x80', '\xE0', '\xA5', '\x8B', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */
++ '\xE0', '\xA4', '\x88', ' ', '\xE0', '\xA4', '\x90', ' ', '\xE0', '\xA4', '\x93', ' ', '\xE0', '\xA4', '\x94', ' ', '\xE0', '\xA4', '\xBF', ' ', '\xE0', '\xA5', '\x80', ' ', '\xE0', '\xA5', '\x8B', ' ', '\xE0', '\xA5', '\x8C', /* ई ऐ ओ औ ि ी ो ौ */
+ '\0',
+- '\xE0', '\xA4', '\x95', '\xE0', '\xA4', '\xAE', '\xE0', '\xA4', '\x85', '\xE0', '\xA4', '\x86', '\xE0', '\xA4', '\xA5', '\xE0', '\xA4', '\xA7', '\xE0', '\xA4', '\xAD', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
++ '\xE0', '\xA4', '\x95', ' ', '\xE0', '\xA4', '\xAE', ' ', '\xE0', '\xA4', '\x85', ' ', '\xE0', '\xA4', '\x86', ' ', '\xE0', '\xA4', '\xA5', ' ', '\xE0', '\xA4', '\xA7', ' ', '\xE0', '\xA4', '\xAD', ' ', '\xE0', '\xA4', '\xB6', /* क म अ आ थ ध भ श */
+ '\0',
+- '\xE0', '\xA5', '\x81', '\xE0', '\xA5', '\x83', /* ु ृ */
++ '\xE0', '\xA5', '\x81', ' ', '\xE0', '\xA5', '\x83', /* ु ृ */
+ '\0',
+- '\xCE', '\x93', '\xCE', '\x92', '\xCE', '\x95', '\xCE', '\x96', '\xCE', '\x98', '\xCE', '\x9F', '\xCE', '\xA9', /* ΓΒΕΖΘΟΩ */
++ '\xCE', '\x93', ' ', '\xCE', '\x92', ' ', '\xCE', '\x95', ' ', '\xCE', '\x96', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', ' ', '\xCE', '\xA9', /* Γ Β Ε Ζ Θ Ο Ω */
+ '\0',
+- '\xCE', '\x92', '\xCE', '\x94', '\xCE', '\x96', '\xCE', '\x9E', '\xCE', '\x98', '\xCE', '\x9F', /* ΒΔΖΞΘΟ */
++ '\xCE', '\x92', ' ', '\xCE', '\x94', ' ', '\xCE', '\x96', ' ', '\xCE', '\x9E', ' ', '\xCE', '\x98', ' ', '\xCE', '\x9F', /* Β Δ Ζ Ξ Θ Ο */
+ '\0',
+- '\xCE', '\xB2', '\xCE', '\xB8', '\xCE', '\xB4', '\xCE', '\xB6', '\xCE', '\xBB', '\xCE', '\xBE', /* βθδζλξ */
++ '\xCE', '\xB2', ' ', '\xCE', '\xB8', ' ', '\xCE', '\xB4', ' ', '\xCE', '\xB6', ' ', '\xCE', '\xBB', ' ', '\xCE', '\xBE', /* β θ δ ζ λ ξ */
+ '\0',
+- '\xCE', '\xB1', '\xCE', '\xB5', '\xCE', '\xB9', '\xCE', '\xBF', '\xCF', '\x80', '\xCF', '\x83', '\xCF', '\x84', '\xCF', '\x89', /* αειοπστω */
++ '\xCE', '\xB1', ' ', '\xCE', '\xB5', ' ', '\xCE', '\xB9', ' ', '\xCE', '\xBF', ' ', '\xCF', '\x80', ' ', '\xCF', '\x83', ' ', '\xCF', '\x84', ' ', '\xCF', '\x89', /* α ε ι ο π σ τ ω */
+ '\0',
+- '\xCE', '\xB2', '\xCE', '\xB3', '\xCE', '\xB7', '\xCE', '\xBC', '\xCF', '\x81', '\xCF', '\x86', '\xCF', '\x87', '\xCF', '\x88', /* βγημρφχψ */
++ '\xCE', '\xB2', ' ', '\xCE', '\xB3', ' ', '\xCE', '\xB7', ' ', '\xCE', '\xBC', ' ', '\xCF', '\x81', ' ', '\xCF', '\x86', ' ', '\xCF', '\x87', ' ', '\xCF', '\x88', /* β γ η μ ρ φ χ ψ */
+ '\0',
+- '\xD7', '\x91', '\xD7', '\x93', '\xD7', '\x94', '\xD7', '\x97', '\xD7', '\x9A', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', /* בדהחךכםס */
++ '\xD7', '\x91', ' ', '\xD7', '\x93', ' ', '\xD7', '\x94', ' ', '\xD7', '\x97', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', /* ב ד ה ח ך כ ם ס */
+ '\0',
+- '\xD7', '\x91', '\xD7', '\x98', '\xD7', '\x9B', '\xD7', '\x9D', '\xD7', '\xA1', '\xD7', '\xA6', /* בטכםסצ */
++ '\xD7', '\x91', ' ', '\xD7', '\x98', ' ', '\xD7', '\x9B', ' ', '\xD7', '\x9D', ' ', '\xD7', '\xA1', ' ', '\xD7', '\xA6', /* ב ט כ ם ס צ */
+ '\0',
+- '\xD7', '\xA7', '\xD7', '\x9A', '\xD7', '\x9F', '\xD7', '\xA3', '\xD7', '\xA5', /* קךןףץ */
++ '\xD7', '\xA7', ' ', '\xD7', '\x9A', ' ', '\xD7', '\x9F', ' ', '\xD7', '\xA3', ' ', '\xD7', '\xA5', /* ק ך ן ף ץ */
+ '\0',
+- '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\x94', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\xA1', '\xE0', '\xBA', '\xA5', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */
++ '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\x94', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\xA1', ' ', '\xE0', '\xBA', '\xA5', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\x87', /* າ ດ ອ ມ ລ ວ ຣ ງ */
+ '\0',
+- '\xE0', '\xBA', '\xB2', '\xE0', '\xBA', '\xAD', '\xE0', '\xBA', '\x9A', '\xE0', '\xBA', '\x8D', '\xE0', '\xBA', '\xA3', '\xE0', '\xBA', '\xAE', '\xE0', '\xBA', '\xA7', '\xE0', '\xBA', '\xA2', /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */
++ '\xE0', '\xBA', '\xB2', ' ', '\xE0', '\xBA', '\xAD', ' ', '\xE0', '\xBA', '\x9A', ' ', '\xE0', '\xBA', '\x8D', ' ', '\xE0', '\xBA', '\xA3', ' ', '\xE0', '\xBA', '\xAE', ' ', '\xE0', '\xBA', '\xA7', ' ', '\xE0', '\xBA', '\xA2', /* າ ອ ບ ຍ ຣ ຮ ວ ຢ */
+ '\0',
+- '\xE0', '\xBA', '\x9B', '\xE0', '\xBA', '\xA2', '\xE0', '\xBA', '\x9F', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ ຝ */
++ '\xE0', '\xBA', '\x9B', ' ', '\xE0', '\xBA', '\xA2', ' ', '\xE0', '\xBA', '\x9F', ' ', '\xE0', '\xBA', '\x9D', /* ປ ຢ ຟ ຝ */
+ '\0',
+- '\xE0', '\xBB', '\x82', '\xE0', '\xBB', '\x84', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */
++ '\xE0', '\xBB', '\x82', ' ', '\xE0', '\xBB', '\x84', ' ', '\xE0', '\xBB', '\x83', /* ໂ ໄ ໃ */
+ '\0',
+- '\xE0', '\xBA', '\x87', '\xE0', '\xBA', '\x8A', '\xE0', '\xBA', '\x96', '\xE0', '\xBA', '\xBD', '\xE0', '\xBB', '\x86', '\xE0', '\xBA', '\xAF', /* ງ ຊ ຖ ຽ ໆ ຯ */
++ '\xE0', '\xBA', '\x87', ' ', '\xE0', '\xBA', '\x8A', ' ', '\xE0', '\xBA', '\x96', ' ', '\xE0', '\xBA', '\xBD', ' ', '\xE0', '\xBB', '\x86', ' ', '\xE0', '\xBA', '\xAF', /* ງ ຊ ຖ ຽ ໆ ຯ */
+ '\0',
+- 'T', 'H', 'E', 'Z', 'O', 'C', 'Q', 'S', /* THEZOCQS */
++ 'T', ' ', 'H', ' ', 'E', ' ', 'Z', ' ', 'O', ' ', 'C', ' ', 'Q', ' ', 'S', /* T H E Z O C Q S */
+ '\0',
+- 'H', 'E', 'Z', 'L', 'O', 'C', 'U', 'S', /* HEZLOCUS */
++ 'H', ' ', 'E', ' ', 'Z', ' ', 'L', ' ', 'O', ' ', 'C', ' ', 'U', ' ', 'S', /* H E Z L O C U S */
+ '\0',
+- 'f', 'i', 'j', 'k', 'd', 'b', 'h', /* fijkdbh */
++ 'f', ' ', 'i', ' ', 'j', ' ', 'k', ' ', 'd', ' ', 'b', ' ', 'h', /* f i j k d b h */
+ '\0',
+- 'x', 'z', 'r', 'o', 'e', 's', 'c', /* xzroesc */
++ 'x', ' ', 'z', ' ', 'r', ' ', 'o', ' ', 'e', ' ', 's', ' ', 'c', /* x z r o e s c */
+ '\0',
+- 'p', 'q', 'g', 'j', 'y', /* pqgjy */
++ 'p', ' ', 'q', ' ', 'g', ' ', 'j', ' ', 'y', /* p q g j y */
+ '\0',
+- '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x85', '\xE2', '\x82', '\x87', '\xE2', '\x82', '\x88', /* ₀₃₅₇₈ */
++ '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x85', ' ', '\xE2', '\x82', '\x87', ' ', '\xE2', '\x82', '\x88', /* ₀ ₃ ₅ ₇ ₈ */
+ '\0',
+- '\xE2', '\x82', '\x80', '\xE2', '\x82', '\x81', '\xE2', '\x82', '\x82', '\xE2', '\x82', '\x83', '\xE2', '\x82', '\x88', /* ₀₁₂₃₈ */
++ '\xE2', '\x82', '\x80', ' ', '\xE2', '\x82', '\x81', ' ', '\xE2', '\x82', '\x82', ' ', '\xE2', '\x82', '\x83', ' ', '\xE2', '\x82', '\x88', /* ₀ ₁ ₂ ₃ ₈ */
+ '\0',
+- '\xE1', '\xB5', '\xA2', '\xE2', '\xB1', '\xBC', '\xE2', '\x82', '\x95', '\xE2', '\x82', '\x96', '\xE2', '\x82', '\x97', /* ᵢⱼₕₖₗ */
++ '\xE1', '\xB5', '\xA2', ' ', '\xE2', '\xB1', '\xBC', ' ', '\xE2', '\x82', '\x95', ' ', '\xE2', '\x82', '\x96', ' ', '\xE2', '\x82', '\x97', /* ᵢ ⱼ ₕ ₖ ₗ */
+ '\0',
+- '\xE2', '\x82', '\x90', '\xE2', '\x82', '\x91', '\xE2', '\x82', '\x92', '\xE2', '\x82', '\x93', '\xE2', '\x82', '\x99', '\xE2', '\x82', '\x9B', '\xE1', '\xB5', '\xA5', '\xE1', '\xB5', '\xA4', '\xE1', '\xB5', '\xA3', /* ₐₑₒₓₙₛᵥᵤᵣ */
++ '\xE2', '\x82', '\x90', ' ', '\xE2', '\x82', '\x91', ' ', '\xE2', '\x82', '\x92', ' ', '\xE2', '\x82', '\x93', ' ', '\xE2', '\x82', '\x99', ' ', '\xE2', '\x82', '\x9B', ' ', '\xE1', '\xB5', '\xA5', ' ', '\xE1', '\xB5', '\xA4', ' ', '\xE1', '\xB5', '\xA3', /* ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ */
+ '\0',
+- '\xE1', '\xB5', '\xA6', '\xE1', '\xB5', '\xA7', '\xE1', '\xB5', '\xA8', '\xE1', '\xB5', '\xA9', '\xE2', '\x82', '\x9A', /* ᵦᵧᵨᵩₚ */
++ '\xE1', '\xB5', '\xA6', ' ', '\xE1', '\xB5', '\xA7', ' ', '\xE1', '\xB5', '\xA8', ' ', '\xE1', '\xB5', '\xA9', ' ', '\xE2', '\x82', '\x9A', /* ᵦ ᵧ ᵨ ᵩ ₚ */
+ '\0',
+- '\xE2', '\x81', '\xB0', '\xC2', '\xB3', '\xE2', '\x81', '\xB5', '\xE2', '\x81', '\xB7', '\xE1', '\xB5', '\x80', '\xE1', '\xB4', '\xB4', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xBC', /* ⁰³⁵⁷ᵀᴴᴱᴼ */
++ '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB3', ' ', '\xE2', '\x81', '\xB5', ' ', '\xE2', '\x81', '\xB7', ' ', '\xE1', '\xB5', '\x80', ' ', '\xE1', '\xB4', '\xB4', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xBC', /* ⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ */
+ '\0',
+- '\xE2', '\x81', '\xB0', '\xC2', '\xB9', '\xC2', '\xB2', '\xC2', '\xB3', '\xE1', '\xB4', '\xB1', '\xE1', '\xB4', '\xB8', '\xE1', '\xB4', '\xBC', '\xE1', '\xB5', '\x81', /* ⁰¹²³ᴱᴸᴼᵁ */
++ '\xE2', '\x81', '\xB0', ' ', '\xC2', '\xB9', ' ', '\xC2', '\xB2', ' ', '\xC2', '\xB3', ' ', '\xE1', '\xB4', '\xB1', ' ', '\xE1', '\xB4', '\xB8', ' ', '\xE1', '\xB4', '\xBC', ' ', '\xE1', '\xB5', '\x81', /* ⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ */
+ '\0',
+- '\xE1', '\xB5', '\x87', '\xE1', '\xB5', '\x88', '\xE1', '\xB5', '\x8F', '\xCA', '\xB0', '\xCA', '\xB2', '\xE1', '\xB6', '\xA0', '\xE2', '\x81', '\xB1', /* ᵇᵈᵏʰʲᶠⁱ */
++ '\xE1', '\xB5', '\x87', ' ', '\xE1', '\xB5', '\x88', ' ', '\xE1', '\xB5', '\x8F', ' ', '\xCA', '\xB0', ' ', '\xCA', '\xB2', ' ', '\xE1', '\xB6', '\xA0', ' ', '\xE2', '\x81', '\xB1', /* ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ */
+ '\0',
+- '\xE1', '\xB5', '\x89', '\xE1', '\xB5', '\x92', '\xCA', '\xB3', '\xCB', '\xA2', '\xCB', '\xA3', '\xE1', '\xB6', '\x9C', '\xE1', '\xB6', '\xBB', /* ᵉᵒʳˢˣᶜᶻ */
++ '\xE1', '\xB5', '\x89', ' ', '\xE1', '\xB5', '\x92', ' ', '\xCA', '\xB3', ' ', '\xCB', '\xA2', ' ', '\xCB', '\xA3', ' ', '\xE1', '\xB6', '\x9C', ' ', '\xE1', '\xB6', '\xBB', /* ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ */
+ '\0',
+- '\xE1', '\xB5', '\x96', '\xCA', '\xB8', '\xE1', '\xB5', '\x8D', /* ᵖʸᵍ */
++ '\xE1', '\xB5', '\x96', ' ', '\xCA', '\xB8', ' ', '\xE1', '\xB5', '\x8D', /* ᵖ ʸ ᵍ */
+ '\0',
+- '\xE0', '\xB0', '\x87', '\xE0', '\xB0', '\x8C', '\xE0', '\xB0', '\x99', '\xE0', '\xB0', '\x9E', '\xE0', '\xB0', '\xA3', '\xE0', '\xB0', '\xB1', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */
++ '\xE0', '\xB0', '\x87', ' ', '\xE0', '\xB0', '\x8C', ' ', '\xE0', '\xB0', '\x99', ' ', '\xE0', '\xB0', '\x9E', ' ', '\xE0', '\xB0', '\xA3', ' ', '\xE0', '\xB0', '\xB1', ' ', '\xE0', '\xB1', '\xAF', /* ఇ ఌ ఙ ఞ ణ ఱ ౯ */
+ '\0',
+- '\xE0', '\xB0', '\x85', '\xE0', '\xB0', '\x95', '\xE0', '\xB0', '\x9A', '\xE0', '\xB0', '\xB0', '\xE0', '\xB0', '\xBD', '\xE0', '\xB1', '\xA8', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */
++ '\xE0', '\xB0', '\x85', ' ', '\xE0', '\xB0', '\x95', ' ', '\xE0', '\xB0', '\x9A', ' ', '\xE0', '\xB0', '\xB0', ' ', '\xE0', '\xB0', '\xBD', ' ', '\xE0', '\xB1', '\xA8', ' ', '\xE0', '\xB1', '\xAC', /* అ క చ ర ఽ ౨ ౬ */
+ '\0',
+- '\xE0', '\xB8', '\x9A', '\xE0', '\xB9', '\x80', '\xE0', '\xB9', '\x81', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\x81', '\xE0', '\xB8', '\xB2', /* บ เ แ อ ก า */
++ '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB9', '\x80', ' ', '\xE0', '\xB9', '\x81', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\x81', ' ', '\xE0', '\xB8', '\xB2', /* บ เ แ อ ก า */
+ '\0',
+- '\xE0', '\xB8', '\x9A', '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\xA9', '\xE0', '\xB8', '\xAF', '\xE0', '\xB8', '\xAD', '\xE0', '\xB8', '\xA2', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */
++ '\xE0', '\xB8', '\x9A', ' ', '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\xA9', ' ', '\xE0', '\xB8', '\xAF', ' ', '\xE0', '\xB8', '\xAD', ' ', '\xE0', '\xB8', '\xA2', ' ', '\xE0', '\xB8', '\xAE', /* บ ป ษ ฯ อ ย ฮ */
+ '\0',
+- '\xE0', '\xB8', '\x9B', '\xE0', '\xB8', '\x9D', '\xE0', '\xB8', '\x9F', /* ป ฝ ฟ */
++ '\xE0', '\xB8', '\x9B', ' ', '\xE0', '\xB8', '\x9D', ' ', '\xE0', '\xB8', '\x9F', /* ป ฝ ฟ */
+ '\0',
+- '\xE0', '\xB9', '\x82', '\xE0', '\xB9', '\x83', '\xE0', '\xB9', '\x84', /* โ ใ ไ */
++ '\xE0', '\xB9', '\x82', ' ', '\xE0', '\xB9', '\x83', ' ', '\xE0', '\xB9', '\x84', /* โ ใ ไ */
+ '\0',
+- '\xE0', '\xB8', '\x8E', '\xE0', '\xB8', '\x8F', '\xE0', '\xB8', '\xA4', '\xE0', '\xB8', '\xA6', /* ฎ ฏ ฤ ฦ */
++ '\xE0', '\xB8', '\x8E', ' ', '\xE0', '\xB8', '\x8F', ' ', '\xE0', '\xB8', '\xA4', ' ', '\xE0', '\xB8', '\xA6', /* ฎ ฏ ฤ ฦ */
+ '\0',
+- '\xE0', '\xB8', '\x8D', '\xE0', '\xB8', '\x90', /* ญ ฐ */
++ '\xE0', '\xB8', '\x8D', ' ', '\xE0', '\xB8', '\x90', /* ญ ฐ */
+ '\0',
+- '\xE0', '\xB9', '\x90', '\xE0', '\xB9', '\x91', '\xE0', '\xB9', '\x93', /* ๐ ๑ ๓ */
++ '\xE0', '\xB9', '\x90', ' ', '\xE0', '\xB9', '\x91', ' ', '\xE0', '\xB9', '\x93', /* ๐ ๑ ๓ */
+ #ifdef AF_CONFIG_OPTION_CJK
+ '\0',
+- '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 他们你來們到和地 */
+- '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', '\xE5', '\xB8', '\xAD', '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x83', /* 对對就席我时時會 */
+- '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\x83', '\xBD', '\xE8', '\x88', '\xB0', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 来為能舰說说这這 */
+- '\xE9', '\xBD', '\x8A', '|', /* 齊 | */
+- '\xE5', '\x86', '\x9B', '\xE5', '\x90', '\x8C', '\xE5', '\xB7', '\xB2', '\xE6', '\x84', '\xBF', '\xE6', '\x97', '\xA2', '\xE6', '\x98', '\x9F', '\xE6', '\x98', '\xAF', '\xE6', '\x99', '\xAF', /* 军同已愿既星是景 */
+- '\xE6', '\xB0', '\x91', '\xE7', '\x85', '\xA7', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\xA8', '\xE7', '\xBD', '\xAE', '\xE8', '\xA6', '\x81', /* 民照现現理用置要 */
+- '\xE8', '\xBB', '\x8D', '\xE9', '\x82', '\xA3', '\xE9', '\x85', '\x8D', '\xE9', '\x87', '\x8C', '\xE9', '\x96', '\x8B', '\xE9', '\x9B', '\xB7', '\xE9', '\x9C', '\xB2', '\xE9', '\x9D', '\xA2', /* 軍那配里開雷露面 */
+- '\xE9', '\xA1', '\xBE', /* 顾 */
+- '\0',
+- '\xE4', '\xB8', '\xAA', '\xE4', '\xB8', '\xBA', '\xE4', '\xBA', '\xBA', '\xE4', '\xBB', '\x96', '\xE4', '\xBB', '\xA5', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', /* 个为人他以们你來 */
+- '\xE5', '\x80', '\x8B', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\xA4', '\xA7', '\xE5', '\xAF', '\xB9', '\xE5', '\xB0', '\x8D', '\xE5', '\xB0', '\xB1', /* 個們到和大对對就 */
+- '\xE6', '\x88', '\x91', '\xE6', '\x97', '\xB6', '\xE6', '\x99', '\x82', '\xE6', '\x9C', '\x89', '\xE6', '\x9D', '\xA5', '\xE7', '\x82', '\xBA', '\xE8', '\xA6', '\x81', '\xE8', '\xAA', '\xAA', /* 我时時有来為要說 */
+- '\xE8', '\xAF', '\xB4', '|', /* 说 | */
+- '\xE4', '\xB8', '\xBB', '\xE4', '\xBA', '\x9B', '\xE5', '\x9B', '\xA0', '\xE5', '\xAE', '\x83', '\xE6', '\x83', '\xB3', '\xE6', '\x84', '\x8F', '\xE7', '\x90', '\x86', '\xE7', '\x94', '\x9F', /* 主些因它想意理生 */
+- '\xE7', '\x95', '\xB6', '\xE7', '\x9C', '\x8B', '\xE7', '\x9D', '\x80', '\xE7', '\xBD', '\xAE', '\xE8', '\x80', '\x85', '\xE8', '\x87', '\xAA', '\xE8', '\x91', '\x97', '\xE8', '\xA3', '\xA1', /* 當看着置者自著裡 */
+- '\xE8', '\xBF', '\x87', '\xE8', '\xBF', '\x98', '\xE8', '\xBF', '\x9B', '\xE9', '\x80', '\xB2', '\xE9', '\x81', '\x8E', '\xE9', '\x81', '\x93', '\xE9', '\x82', '\x84', '\xE9', '\x87', '\x8C', /* 过还进進過道還里 */
+- '\xE9', '\x9D', '\xA2', /* 面 */
++ '\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 他 们 你 來 們 到 和 地 */
++ ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB8', '\xAD', ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x83', /* 对 對 就 席 我 时 時 會 */
++ ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\x88', '\xB0', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 来 為 能 舰 說 说 这 這 */
++ ' ', '\xE9', '\xBD', '\x8A', ' ', '|', /* 齊 | */
++ ' ', '\xE5', '\x86', '\x9B', ' ', '\xE5', '\x90', '\x8C', ' ', '\xE5', '\xB7', '\xB2', ' ', '\xE6', '\x84', '\xBF', ' ', '\xE6', '\x97', '\xA2', ' ', '\xE6', '\x98', '\x9F', ' ', '\xE6', '\x98', '\xAF', ' ', '\xE6', '\x99', '\xAF', /* 军 同 已 愿 既 星 是 景 */
++ ' ', '\xE6', '\xB0', '\x91', ' ', '\xE7', '\x85', '\xA7', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\xA8', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\xA6', '\x81', /* 民 照 现 現 理 用 置 要 */
++ ' ', '\xE8', '\xBB', '\x8D', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x85', '\x8D', ' ', '\xE9', '\x87', '\x8C', ' ', '\xE9', '\x96', '\x8B', ' ', '\xE9', '\x9B', '\xB7', ' ', '\xE9', '\x9C', '\xB2', ' ', '\xE9', '\x9D', '\xA2', /* 軍 那 配 里 開 雷 露 面 */
++ ' ', '\xE9', '\xA1', '\xBE', /* 顾 */
++ '\0',
++ '\xE4', '\xB8', '\xAA', ' ', '\xE4', '\xB8', '\xBA', ' ', '\xE4', '\xBA', '\xBA', ' ', '\xE4', '\xBB', '\x96', ' ', '\xE4', '\xBB', '\xA5', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', /* 个 为 人 他 以 们 你 來 */
++ ' ', '\xE5', '\x80', '\x8B', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\xA4', '\xA7', ' ', '\xE5', '\xAF', '\xB9', ' ', '\xE5', '\xB0', '\x8D', ' ', '\xE5', '\xB0', '\xB1', /* 個 們 到 和 大 对 對 就 */
++ ' ', '\xE6', '\x88', '\x91', ' ', '\xE6', '\x97', '\xB6', ' ', '\xE6', '\x99', '\x82', ' ', '\xE6', '\x9C', '\x89', ' ', '\xE6', '\x9D', '\xA5', ' ', '\xE7', '\x82', '\xBA', ' ', '\xE8', '\xA6', '\x81', ' ', '\xE8', '\xAA', '\xAA', /* 我 时 時 有 来 為 要 說 */
++ ' ', '\xE8', '\xAF', '\xB4', ' ', '|', /* 说 | */
++ ' ', '\xE4', '\xB8', '\xBB', ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE5', '\x9B', '\xA0', ' ', '\xE5', '\xAE', '\x83', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x84', '\x8F', ' ', '\xE7', '\x90', '\x86', ' ', '\xE7', '\x94', '\x9F', /* 主 些 因 它 想 意 理 生 */
++ ' ', '\xE7', '\x95', '\xB6', ' ', '\xE7', '\x9C', '\x8B', ' ', '\xE7', '\x9D', '\x80', ' ', '\xE7', '\xBD', '\xAE', ' ', '\xE8', '\x80', '\x85', ' ', '\xE8', '\x87', '\xAA', ' ', '\xE8', '\x91', '\x97', ' ', '\xE8', '\xA3', '\xA1', /* 當 看 着 置 者 自 著 裡 */
++ ' ', '\xE8', '\xBF', '\x87', ' ', '\xE8', '\xBF', '\x98', ' ', '\xE8', '\xBF', '\x9B', ' ', '\xE9', '\x80', '\xB2', ' ', '\xE9', '\x81', '\x8E', ' ', '\xE9', '\x81', '\x93', ' ', '\xE9', '\x82', '\x84', ' ', '\xE9', '\x87', '\x8C', /* 过 还 进 進 過 道 還 里 */
++ ' ', '\xE9', '\x9D', '\xA2', /* 面 */
+ #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+ '\0',
+- '\xE4', '\xBA', '\x9B', '\xE4', '\xBB', '\xAC', '\xE4', '\xBD', '\xA0', '\xE4', '\xBE', '\x86', '\xE5', '\x80', '\x91', '\xE5', '\x88', '\xB0', '\xE5', '\x92', '\x8C', '\xE5', '\x9C', '\xB0', /* 些们你來們到和地 */
+- '\xE5', '\xA5', '\xB9', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE5', '\xB0', '\xB1', '\xE5', '\xB9', '\xB4', '\xE5', '\xBE', '\x97', '\xE6', '\x83', '\x85', '\xE6', '\x9C', '\x80', /* 她将將就年得情最 */
+- '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE7', '\x90', '\x86', '\xE8', '\x83', '\xBD', '\xE8', '\xAA', '\xAA', '\xE8', '\xAF', '\xB4', '\xE8', '\xBF', '\x99', '\xE9', '\x80', '\x99', /* 样樣理能說说这這 */
+- '\xE9', '\x80', '\x9A', '|', /* 通 | */
+- '\xE5', '\x8D', '\xB3', '\xE5', '\x90', '\x97', '\xE5', '\x90', '\xA7', '\xE5', '\x90', '\xAC', '\xE5', '\x91', '\xA2', '\xE5', '\x93', '\x81', '\xE5', '\x93', '\x8D', '\xE5', '\x97', '\x8E', /* 即吗吧听呢品响嗎 */
+- '\xE5', '\xB8', '\x88', '\xE5', '\xB8', '\xAB', '\xE6', '\x94', '\xB6', '\xE6', '\x96', '\xAD', '\xE6', '\x96', '\xB7', '\xE6', '\x98', '\x8E', '\xE7', '\x9C', '\xBC', '\xE9', '\x96', '\x93', /* 师師收断斷明眼間 */
+- '\xE9', '\x97', '\xB4', '\xE9', '\x99', '\x85', '\xE9', '\x99', '\x88', '\xE9', '\x99', '\x90', '\xE9', '\x99', '\xA4', '\xE9', '\x99', '\xB3', '\xE9', '\x9A', '\x8F', '\xE9', '\x9A', '\x9B', /* 间际陈限除陳随際 */
+- '\xE9', '\x9A', '\xA8', /* 隨 */
+- '\0',
+- '\xE4', '\xBA', '\x8B', '\xE5', '\x89', '\x8D', '\xE5', '\xAD', '\xB8', '\xE5', '\xB0', '\x86', '\xE5', '\xB0', '\x87', '\xE6', '\x83', '\x85', '\xE6', '\x83', '\xB3', '\xE6', '\x88', '\x96', /* 事前學将將情想或 */
+- '\xE6', '\x94', '\xBF', '\xE6', '\x96', '\xAF', '\xE6', '\x96', '\xB0', '\xE6', '\xA0', '\xB7', '\xE6', '\xA8', '\xA3', '\xE6', '\xB0', '\x91', '\xE6', '\xB2', '\x92', '\xE6', '\xB2', '\xA1', /* 政斯新样樣民沒没 */
+- '\xE7', '\x84', '\xB6', '\xE7', '\x89', '\xB9', '\xE7', '\x8E', '\xB0', '\xE7', '\x8F', '\xBE', '\xE7', '\x90', '\x83', '\xE7', '\xAC', '\xAC', '\xE7', '\xB6', '\x93', '\xE8', '\xB0', '\x81', /* 然特现現球第經谁 */
+- '\xE8', '\xB5', '\xB7', '|', /* 起 | */
+- '\xE4', '\xBE', '\x8B', '\xE5', '\x88', '\xA5', '\xE5', '\x88', '\xAB', '\xE5', '\x88', '\xB6', '\xE5', '\x8A', '\xA8', '\xE5', '\x8B', '\x95', '\xE5', '\x90', '\x97', '\xE5', '\x97', '\x8E', /* 例別别制动動吗嗎 */
+- '\xE5', '\xA2', '\x9E', '\xE6', '\x8C', '\x87', '\xE6', '\x98', '\x8E', '\xE6', '\x9C', '\x9D', '\xE6', '\x9C', '\x9F', '\xE6', '\x9E', '\x84', '\xE7', '\x89', '\xA9', '\xE7', '\xA1', '\xAE', /* 增指明朝期构物确 */
+- '\xE7', '\xA7', '\x8D', '\xE8', '\xAA', '\xBF', '\xE8', '\xB0', '\x83', '\xE8', '\xB2', '\xBB', '\xE8', '\xB4', '\xB9', '\xE9', '\x82', '\xA3', '\xE9', '\x83', '\xBD', '\xE9', '\x96', '\x93', /* 种調调費费那都間 */
+- '\xE9', '\x97', '\xB4', /* 间 */
++ ' ', '\xE4', '\xBA', '\x9B', ' ', '\xE4', '\xBB', '\xAC', ' ', '\xE4', '\xBD', '\xA0', ' ', '\xE4', '\xBE', '\x86', ' ', '\xE5', '\x80', '\x91', ' ', '\xE5', '\x88', '\xB0', ' ', '\xE5', '\x92', '\x8C', ' ', '\xE5', '\x9C', '\xB0', /* 些 们 你 來 們 到 和 地 */
++ ' ', '\xE5', '\xA5', '\xB9', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE5', '\xB0', '\xB1', ' ', '\xE5', '\xB9', '\xB4', ' ', '\xE5', '\xBE', '\x97', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x9C', '\x80', /* 她 将 將 就 年 得 情 最 */
++ ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE7', '\x90', '\x86', ' ', '\xE8', '\x83', '\xBD', ' ', '\xE8', '\xAA', '\xAA', ' ', '\xE8', '\xAF', '\xB4', ' ', '\xE8', '\xBF', '\x99', ' ', '\xE9', '\x80', '\x99', /* 样 樣 理 能 說 说 这 這 */
++ ' ', '\xE9', '\x80', '\x9A', ' ', '|', /* 通 | */
++ ' ', '\xE5', '\x8D', '\xB3', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x90', '\xA7', ' ', '\xE5', '\x90', '\xAC', ' ', '\xE5', '\x91', '\xA2', ' ', '\xE5', '\x93', '\x81', ' ', '\xE5', '\x93', '\x8D', ' ', '\xE5', '\x97', '\x8E', /* 即 吗 吧 听 呢 品 响 嗎 */
++ ' ', '\xE5', '\xB8', '\x88', ' ', '\xE5', '\xB8', '\xAB', ' ', '\xE6', '\x94', '\xB6', ' ', '\xE6', '\x96', '\xAD', ' ', '\xE6', '\x96', '\xB7', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE7', '\x9C', '\xBC', ' ', '\xE9', '\x96', '\x93', /* 师 師 收 断 斷 明 眼 間 */
++ ' ', '\xE9', '\x97', '\xB4', ' ', '\xE9', '\x99', '\x85', ' ', '\xE9', '\x99', '\x88', ' ', '\xE9', '\x99', '\x90', ' ', '\xE9', '\x99', '\xA4', ' ', '\xE9', '\x99', '\xB3', ' ', '\xE9', '\x9A', '\x8F', ' ', '\xE9', '\x9A', '\x9B', /* 间 际 陈 限 除 陳 随 際 */
++ ' ', '\xE9', '\x9A', '\xA8', /* 隨 */
++ '\0',
++ '\xE4', '\xBA', '\x8B', ' ', '\xE5', '\x89', '\x8D', ' ', '\xE5', '\xAD', '\xB8', ' ', '\xE5', '\xB0', '\x86', ' ', '\xE5', '\xB0', '\x87', ' ', '\xE6', '\x83', '\x85', ' ', '\xE6', '\x83', '\xB3', ' ', '\xE6', '\x88', '\x96', /* 事 前 學 将 將 情 想 或 */
++ ' ', '\xE6', '\x94', '\xBF', ' ', '\xE6', '\x96', '\xAF', ' ', '\xE6', '\x96', '\xB0', ' ', '\xE6', '\xA0', '\xB7', ' ', '\xE6', '\xA8', '\xA3', ' ', '\xE6', '\xB0', '\x91', ' ', '\xE6', '\xB2', '\x92', ' ', '\xE6', '\xB2', '\xA1', /* 政 斯 新 样 樣 民 沒 没 */
++ ' ', '\xE7', '\x84', '\xB6', ' ', '\xE7', '\x89', '\xB9', ' ', '\xE7', '\x8E', '\xB0', ' ', '\xE7', '\x8F', '\xBE', ' ', '\xE7', '\x90', '\x83', ' ', '\xE7', '\xAC', '\xAC', ' ', '\xE7', '\xB6', '\x93', ' ', '\xE8', '\xB0', '\x81', /* 然 特 现 現 球 第 經 谁 */
++ ' ', '\xE8', '\xB5', '\xB7', ' ', '|', /* 起 | */
++ ' ', '\xE4', '\xBE', '\x8B', ' ', '\xE5', '\x88', '\xA5', ' ', '\xE5', '\x88', '\xAB', ' ', '\xE5', '\x88', '\xB6', ' ', '\xE5', '\x8A', '\xA8', ' ', '\xE5', '\x8B', '\x95', ' ', '\xE5', '\x90', '\x97', ' ', '\xE5', '\x97', '\x8E', /* 例 別 别 制 动 動 吗 嗎 */
++ ' ', '\xE5', '\xA2', '\x9E', ' ', '\xE6', '\x8C', '\x87', ' ', '\xE6', '\x98', '\x8E', ' ', '\xE6', '\x9C', '\x9D', ' ', '\xE6', '\x9C', '\x9F', ' ', '\xE6', '\x9E', '\x84', ' ', '\xE7', '\x89', '\xA9', ' ', '\xE7', '\xA1', '\xAE', /* 增 指 明 朝 期 构 物 确 */
++ ' ', '\xE7', '\xA7', '\x8D', ' ', '\xE8', '\xAA', '\xBF', ' ', '\xE8', '\xB0', '\x83', ' ', '\xE8', '\xB2', '\xBB', ' ', '\xE8', '\xB4', '\xB9', ' ', '\xE9', '\x82', '\xA3', ' ', '\xE9', '\x83', '\xBD', ' ', '\xE9', '\x96', '\x93', /* 种 調 调 費 费 那 都 間 */
++ ' ', '\xE9', '\x97', '\xB4', /* 间 */
+ #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+ #endif /* AF_CONFIG_OPTION_CJK */
+ '\0',
+diff --git a/src/autofit/afblue.dat b/src/autofit/afblue.dat
+index 1b52378..117f025 100644
+--- a/src/autofit/afblue.dat
++++ b/src/autofit/afblue.dat
+@@ -20,9 +20,8 @@
+ // labels separated by whitespace and followed by a colon (everything in a
+ // single line); the first label gives the name of the enumeration template,
+ // the second the name of the array template, and the third the name of the
+-// `maximum' template, holding the size of the largest array element. The
+-// script then fills the corresponding templates (indicated by `@'
+-// characters around the name).
++// `maximum' template. The script then fills the corresponding templates
++// (indicated by `@' characters around the name).
+ //
+ // A section contains one or more data records. Each data record consists
+ // of two or more lines. The first line holds the enumeration name, and the
+@@ -30,15 +29,20 @@
+ //
+ // There are two possible representations for array data.
+ //
+-// - A string of characters in UTF-8 encoding enclosed in double quotes,
+-// using C syntax. There can be only one string per line, thus the
+-// starting and ending double quote must be the first and last character
+-// in the line, respectively, ignoring whitespace before and after the
+-// string. Space characters within the string are ignored too. If there
+-// are multiple strings (in multiple lines), they are concatenated to a
+-// single string. In the output, a string gets represented as a series of
+-// singles bytes, followed by a zero byte. The enumeration values simply
+-// hold byte offsets to the start of the corresponding strings.
++// - A string of characters or character clusters (for example, representing
++// Aksharas, Devanagari syllables) in UTF-8 encoding enclosed in double
++// quotes, using C syntax, where the elements are separated by spaces.
++// There can be only one string per line, thus the starting and ending
++// double quote must be the first and last character in the line,
++// respectively, ignoring whitespace before and after the string. If
++// there are multiple strings (in multiple lines), they are concatenated
++// to a single string. In the output, a string gets represented as a
++// series of singles bytes, followed by a zero byte. The enumeration
++// values simply hold byte offsets to the start of the corresponding
++// strings.
++//
++// For strings, the `maximum' template holds the maximum number of
++// non-space characters in all strings.
+ //
+ // - Data blocks enclosed in balanced braces, which get copied verbatim and
+ // which can span multiple lines. The opening brace of a block must be
+@@ -47,6 +51,9 @@
+ // character after each block and counts the number of blocks to set the
+ // enumeration values.
+ //
++// For data blocks, the `maximum' template holds the maximum number of
++// array elements.
++//
+ // A section can contain either strings only or data blocks only.
+ //
+ // A comment line starts with `//'; it gets removed. A preprocessor
+@@ -80,16 +87,14 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ "ـ"
+
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP
+- "БВЕПЗОСЭ"
++ "Б В Е П З О С Э"
+ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM
+- "БВЕШЗОСЭ"
++ "Б В Е Ш З О С Э"
+ AF_BLUE_STRING_CYRILLIC_SMALL
+- "хпншезос"
++ "х п н ш е з о с"
+ AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER
+- "руф"
++ "р у ф"
+
+- // we separate the letters with spaces to avoid ligatures;
+- // this is just for convenience to simplify reading
+ AF_BLUE_STRING_DEVANAGARI_BASE
+ "क म अ आ थ ध भ श"
+ AF_BLUE_STRING_DEVANAGARI_TOP
+@@ -103,22 +108,22 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ "ु ृ"
+
+ AF_BLUE_STRING_GREEK_CAPITAL_TOP
+- "ΓΒΕΖΘΟΩ"
++ "Γ Β Ε Ζ Θ Ο Ω"
+ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM
+- "ΒΔΖΞΘΟ"
++ "Β Δ Ζ Ξ Θ Ο"
+ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP
+- "βθδζλξ"
++ "β θ δ ζ λ ξ"
+ AF_BLUE_STRING_GREEK_SMALL
+- "αειοπστω"
++ "α ε ι ο π σ τ ω"
+ AF_BLUE_STRING_GREEK_SMALL_DESCENDER
+- "βγημρφχψ"
++ "β γ η μ ρ φ χ ψ"
+
+ AF_BLUE_STRING_HEBREW_TOP
+- "בדהחךכםס"
++ "ב ד ה ח ך כ ם ס"
+ AF_BLUE_STRING_HEBREW_BOTTOM
+- "בטכםסצ"
++ "ב ט כ ם ס צ"
+ AF_BLUE_STRING_HEBREW_DESCENDER
+- "קךןףץ"
++ "ק ך ן ף ץ"
+
+ AF_BLUE_STRING_LAO_TOP
+ "າ ດ ອ ມ ລ ວ ຣ ງ"
+@@ -132,43 +137,41 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ "ງ ຊ ຖ ຽ ໆ ຯ"
+
+ AF_BLUE_STRING_LATIN_CAPITAL_TOP
+- "THEZOCQS"
++ "T H E Z O C Q S"
+ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM
+- "HEZLOCUS"
++ "H E Z L O C U S"
+ AF_BLUE_STRING_LATIN_SMALL_F_TOP
+- "fijkdbh"
++ "f i j k d b h"
+ AF_BLUE_STRING_LATIN_SMALL
+- "xzroesc"
++ "x z r o e s c"
+ AF_BLUE_STRING_LATIN_SMALL_DESCENDER
+- "pqgjy"
++ "p q g j y"
+
+ // we assume that both the subscript and superscript ranges
+ // don't contain oldstyle digits (actually, most fonts probably
+ // have digits only in those ranges)
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP
+- "₀₃₅₇₈"
++ "₀ ₃ ₅ ₇ ₈"
+ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM
+- "₀₁₂₃₈"
++ "₀ ₁ ₂ ₃ ₈"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP
+- "ᵢⱼₕₖₗ"
++ "ᵢ ⱼ ₕ ₖ ₗ"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL
+- "ₐₑₒₓₙₛᵥᵤᵣ"
++ "ₐ ₑ ₒ ₓ ₙ ₛ ᵥ ᵤ ᵣ"
+ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER
+- "ᵦᵧᵨᵩₚ"
++ "ᵦ ᵧ ᵨ ᵩ ₚ"
+
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP
+- "⁰³⁵⁷ᵀᴴᴱᴼ"
++ "⁰ ³ ⁵ ⁷ ᵀ ᴴ ᴱ ᴼ"
+ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM
+- "⁰¹²³ᴱᴸᴼᵁ"
++ "⁰ ¹ ² ³ ᴱ ᴸ ᴼ ᵁ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP
+- "ᵇᵈᵏʰʲᶠⁱ"
++ "ᵇ ᵈ ᵏ ʰ ʲ ᶠ ⁱ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL
+- "ᵉᵒʳˢˣᶜᶻ"
++ "ᵉ ᵒ ʳ ˢ ˣ ᶜ ᶻ"
+ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER
+- "ᵖʸᵍ"
++ "ᵖ ʸ ᵍ"
+
+- // we separate the letters with spaces to avoid ligatures;
+- // this is just for convenience to simplify reading
+ AF_BLUE_STRING_TELUGU_TOP
+ "ఇ ఌ ఙ ఞ ణ ఱ ౯"
+ AF_BLUE_STRING_TELUGU_BOTTOM
+@@ -193,44 +196,44 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ #ifdef AF_CONFIG_OPTION_CJK
+
+ AF_BLUE_STRING_CJK_TOP
+- "他们你來們到和地"
+- "对對就席我时時會"
+- "来為能舰說说这這"
+- "齊 |"
+- "军同已愿既星是景"
+- "民照现現理用置要"
+- "軍那配里開雷露面"
+- "顾"
++ "他 们 你 來 們 到 和 地"
++ " 对 對 就 席 我 时 時 會"
++ " 来 為 能 舰 說 说 这 這"
++ " 齊 |"
++ " 军 同 已 愿 既 星 是 景"
++ " 民 照 现 現 理 用 置 要"
++ " 軍 那 配 里 開 雷 露 面"
++ " 顾"
+ AF_BLUE_STRING_CJK_BOTTOM
+- "个为人他以们你來"
+- "個們到和大对對就"
+- "我时時有来為要說"
+- "说 |"
+- "主些因它想意理生"
+- "當看着置者自著裡"
+- "过还进進過道還里"
+- "面"
++ "个 为 人 他 以 们 你 來"
++ " 個 們 到 和 大 对 對 就"
++ " 我 时 時 有 来 為 要 說"
++ " 说 |"
++ " 主 些 因 它 想 意 理 生"
++ " 當 看 着 置 者 自 著 裡"
++ " 过 还 进 進 過 道 還 里"
++ " 面"
+
+ #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+
+ AF_BLUE_STRING_CJK_LEFT
+- "些们你來們到和地"
+- "她将將就年得情最"
+- "样樣理能說说这這"
+- "通 |"
+- "即吗吧听呢品响嗎"
+- "师師收断斷明眼間"
+- "间际陈限除陳随際"
+- "隨"
++ " 些 们 你 來 們 到 和 地"
++ " 她 将 將 就 年 得 情 最"
++ " 样 樣 理 能 說 说 这 這"
++ " 通 |"
++ " 即 吗 吧 听 呢 品 响 嗎"
++ " 师 師 收 断 斷 明 眼 間"
++ " 间 际 陈 限 除 陳 随 際"
++ " 隨"
+ AF_BLUE_STRING_CJK_RIGHT
+- "事前學将將情想或"
+- "政斯新样樣民沒没"
+- "然特现現球第經谁"
+- "起 |"
+- "例別别制动動吗嗎"
+- "增指明朝期构物确"
+- "种調调費费那都間"
+- "间"
++ "事 前 學 将 將 情 想 或"
++ " 政 斯 新 样 樣 民 沒 没"
++ " 然 特 现 現 球 第 經 谁"
++ " 起 |"
++ " 例 別 别 制 动 動 吗 嗎"
++ " 增 指 明 朝 期 构 物 确"
++ " 种 調 调 費 费 那 都 間"
++ " 间"
+
+ #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+
+@@ -307,11 +310,11 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
+ //
+ // Characters in a blue string are *not* automatically classified. Instead,
+ // first come the characters used for the overshoot value, then the
+-// character `|', then the characters used for the reference value. The
+-// blue zone is then set up by the mean values of all reference values and
+-// all overshoot values, respectively. Both horizontal and vertical blue
+-// zones (i.e., adjusting vertical and horizontal coordinate values,
+-// respectively) are supported.
++// character `|', then the characters used for the reference value
++// (everything separated by space characters). The blue zone is then set up
++// by the mean values of all reference values and all overshoot values,
++// respectively. Both horizontal and vertical blue zones (i.e., adjusting
++// vertical and horizontal coordinate values, respectively) are supported.
+ //
+ // For the cjk auto-hinter, the overshoot should be smaller than the
+ // reference for top zones, and vice versa for bottom zones.
+diff --git a/src/autofit/afblue.h b/src/autofit/afblue.h
+index a79098a..2ee1ed1 100644
+--- a/src/autofit/afblue.h
++++ b/src/autofit/afblue.h
+@@ -78,62 +78,62 @@ FT_BEGIN_HEADER
+ typedef enum AF_Blue_String_
+ {
+ AF_BLUE_STRING_ARABIC_TOP = 0,
+- AF_BLUE_STRING_ARABIC_BOTTOM = 13,
+- AF_BLUE_STRING_ARABIC_JOIN = 24,
+- AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 27,
+- AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 44,
+- AF_BLUE_STRING_CYRILLIC_SMALL = 61,
+- AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 78,
+- AF_BLUE_STRING_DEVANAGARI_BASE = 85,
+- AF_BLUE_STRING_DEVANAGARI_TOP = 110,
+- AF_BLUE_STRING_DEVANAGARI_HEAD = 135,
+- AF_BLUE_STRING_DEVANAGARI_BOTTOM = 160,
+- AF_BLUE_STRING_GREEK_CAPITAL_TOP = 167,
+- AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 182,
+- AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 195,
+- AF_BLUE_STRING_GREEK_SMALL = 208,
+- AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 225,
+- AF_BLUE_STRING_HEBREW_TOP = 242,
+- AF_BLUE_STRING_HEBREW_BOTTOM = 259,
+- AF_BLUE_STRING_HEBREW_DESCENDER = 272,
+- AF_BLUE_STRING_LAO_TOP = 283,
+- AF_BLUE_STRING_LAO_BOTTOM = 308,
+- AF_BLUE_STRING_LAO_ASCENDER = 333,
+- AF_BLUE_STRING_LAO_LARGE_ASCENDER = 346,
+- AF_BLUE_STRING_LAO_DESCENDER = 356,
+- AF_BLUE_STRING_LATIN_CAPITAL_TOP = 375,
+- AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 384,
+- AF_BLUE_STRING_LATIN_SMALL_F_TOP = 393,
+- AF_BLUE_STRING_LATIN_SMALL = 401,
+- AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 409,
+- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 415,
+- AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 431,
+- AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 447,
+- AF_BLUE_STRING_LATIN_SUBS_SMALL = 463,
+- AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 491,
+- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 507,
+- AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 531,
+- AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 553,
+- AF_BLUE_STRING_LATIN_SUPS_SMALL = 573,
+- AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 592,
+- AF_BLUE_STRING_TELUGU_TOP = 601,
+- AF_BLUE_STRING_TELUGU_BOTTOM = 623,
+- AF_BLUE_STRING_THAI_TOP = 645,
+- AF_BLUE_STRING_THAI_BOTTOM = 664,
+- AF_BLUE_STRING_THAI_ASCENDER = 686,
+- AF_BLUE_STRING_THAI_LARGE_ASCENDER = 696,
+- AF_BLUE_STRING_THAI_DESCENDER = 706,
+- AF_BLUE_STRING_THAI_LARGE_DESCENDER = 719,
+- AF_BLUE_STRING_THAI_DIGIT_TOP = 726,
+- af_blue_1_1 = 735,
++ AF_BLUE_STRING_ARABIC_BOTTOM = 18,
++ AF_BLUE_STRING_ARABIC_JOIN = 33,
++ AF_BLUE_STRING_CYRILLIC_CAPITAL_TOP = 36,
++ AF_BLUE_STRING_CYRILLIC_CAPITAL_BOTTOM = 60,
++ AF_BLUE_STRING_CYRILLIC_SMALL = 84,
++ AF_BLUE_STRING_CYRILLIC_SMALL_DESCENDER = 108,
++ AF_BLUE_STRING_DEVANAGARI_BASE = 117,
++ AF_BLUE_STRING_DEVANAGARI_TOP = 149,
++ AF_BLUE_STRING_DEVANAGARI_HEAD = 181,
++ AF_BLUE_STRING_DEVANAGARI_BOTTOM = 213,
++ AF_BLUE_STRING_GREEK_CAPITAL_TOP = 221,
++ AF_BLUE_STRING_GREEK_CAPITAL_BOTTOM = 242,
++ AF_BLUE_STRING_GREEK_SMALL_BETA_TOP = 260,
++ AF_BLUE_STRING_GREEK_SMALL = 278,
++ AF_BLUE_STRING_GREEK_SMALL_DESCENDER = 302,
++ AF_BLUE_STRING_HEBREW_TOP = 326,
++ AF_BLUE_STRING_HEBREW_BOTTOM = 350,
++ AF_BLUE_STRING_HEBREW_DESCENDER = 368,
++ AF_BLUE_STRING_LAO_TOP = 383,
++ AF_BLUE_STRING_LAO_BOTTOM = 415,
++ AF_BLUE_STRING_LAO_ASCENDER = 447,
++ AF_BLUE_STRING_LAO_LARGE_ASCENDER = 463,
++ AF_BLUE_STRING_LAO_DESCENDER = 475,
++ AF_BLUE_STRING_LATIN_CAPITAL_TOP = 499,
++ AF_BLUE_STRING_LATIN_CAPITAL_BOTTOM = 515,
++ AF_BLUE_STRING_LATIN_SMALL_F_TOP = 531,
++ AF_BLUE_STRING_LATIN_SMALL = 545,
++ AF_BLUE_STRING_LATIN_SMALL_DESCENDER = 559,
++ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_TOP = 569,
++ AF_BLUE_STRING_LATIN_SUBS_CAPITAL_BOTTOM = 589,
++ AF_BLUE_STRING_LATIN_SUBS_SMALL_F_TOP = 609,
++ AF_BLUE_STRING_LATIN_SUBS_SMALL = 629,
++ AF_BLUE_STRING_LATIN_SUBS_SMALL_DESCENDER = 665,
++ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_TOP = 685,
++ AF_BLUE_STRING_LATIN_SUPS_CAPITAL_BOTTOM = 716,
++ AF_BLUE_STRING_LATIN_SUPS_SMALL_F_TOP = 745,
++ AF_BLUE_STRING_LATIN_SUPS_SMALL = 771,
++ AF_BLUE_STRING_LATIN_SUPS_SMALL_DESCENDER = 796,
++ AF_BLUE_STRING_TELUGU_TOP = 807,
++ AF_BLUE_STRING_TELUGU_BOTTOM = 835,
++ AF_BLUE_STRING_THAI_TOP = 863,
++ AF_BLUE_STRING_THAI_BOTTOM = 887,
++ AF_BLUE_STRING_THAI_ASCENDER = 915,
++ AF_BLUE_STRING_THAI_LARGE_ASCENDER = 927,
++ AF_BLUE_STRING_THAI_DESCENDER = 939,
++ AF_BLUE_STRING_THAI_LARGE_DESCENDER = 955,
++ AF_BLUE_STRING_THAI_DIGIT_TOP = 963,
++ af_blue_1_1 = 974,
+ #ifdef AF_CONFIG_OPTION_CJK
+ AF_BLUE_STRING_CJK_TOP = af_blue_1_1 + 1,
+- AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 153,
+- af_blue_1_1_1 = af_blue_1_1 + 304,
++ AF_BLUE_STRING_CJK_BOTTOM = af_blue_1_1 + 203,
++ af_blue_1_1_1 = af_blue_1_1 + 404,
+ #ifdef AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT
+ AF_BLUE_STRING_CJK_LEFT = af_blue_1_1_1 + 1,
+- AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 153,
+- af_blue_1_1_2 = af_blue_1_1_1 + 304,
++ AF_BLUE_STRING_CJK_RIGHT = af_blue_1_1_1 + 204,
++ af_blue_1_1_2 = af_blue_1_1_1 + 405,
+ #else
+ af_blue_1_1_2 = af_blue_1_1_1 + 0,
+ #endif /* AF_CONFIG_OPTION_CJK_BLUE_HANI_VERT */
+--
+2.6.3
+
diff --git a/03-infinality-2.6-2015.08.24.patch b/03-infinality-2.6.2-2015.12.05.patch
index 0b01a13db30..7a4a07243e7 100644
--- a/03-infinality-2.6-2015.08.24.patch
+++ b/03-infinality-2.6.2-2015.12.05.patch
@@ -24,7 +24,7 @@ index fd52581..bb81fb8 100755
# respect GNUMAKE environment variable for backwards compatibility
diff --git a/devel/ftoption.h b/devel/ftoption.h
-index eda772e..d408a5d 100644
+index f68b3ad..fb01836 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -607,6 +607,17 @@ FT_BEGIN_HEADER
@@ -46,7 +46,7 @@ index eda772e..d408a5d 100644
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. The patents related to */
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
-index 4970945..3df05be 100644
+index b481f8f..b05932a 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
@@ -83,18 +83,22 @@ index 4970945..3df05be 100644
/* of the TrueType bytecode interpreter is used that doesn't implement */
/* any of the patented opcodes and algorithms. The patents related to */
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
-index 3065895..214c217 100644
+index 53851e7..c20e7d3 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
-@@ -24,6 +24,7 @@
+@@ -24,7 +24,10 @@
#include "afpic.h"
#include "aflatin.h"
#include "aferrors.h"
+-
+#include "strings.h"
-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "../base/ftinf.h"
++#endif
#ifdef AF_CONFIG_OPTION_USE_WARPER
-@@ -40,6 +41,10 @@
+ #include "afwarp.h"
+@@ -40,6 +43,10 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_aflatin
@@ -105,41 +109,19 @@ index 3065895..214c217 100644
/* needed for computation of round vs. flat segments */
#define FLAT_THRESHOLD( x ) ( x / 14 )
-@@ -899,8 +904,33 @@
+@@ -916,7 +923,10 @@
FT_Pos delta;
AF_LatinAxis axis;
FT_UInt nn;
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ int checked_adjust_heights_env = 0;
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ FT_Bool adjust_heights = FALSE;
-
-
-+ if ( checked_adjust_heights_env == 0 )
-+ {
-+ char *adjust_heights_env =
-+ getenv( "INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS" );
-+ if ( adjust_heights_env != NULL )
-+ {
-+ if ( strcasecmp(adjust_heights_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp(adjust_heights_env, "true") == 0 )
-+ adjust_heights = TRUE;
-+ else if ( strcasecmp(adjust_heights_env, "1") == 0 )
-+ adjust_heights = TRUE;
-+ else if ( strcasecmp(adjust_heights_env, "on") == 0 )
-+ adjust_heights = TRUE;
-+ else if ( strcasecmp(adjust_heights_env, "yes") == 0 )
-+ adjust_heights = TRUE;
-+ }
-+ }
-+ checked_adjust_heights_env = 1;
-+ }
++ if(ftinf) adjust_heights=ftinf->autohint_increase_glyph_heights;
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
-+
+
if ( dim == AF_DIMENSION_HORZ )
{
- scale = scaler->x_scale;
-@@ -927,7 +957,7 @@
+@@ -944,7 +954,7 @@
{
AF_LatinAxis Axis = &metrics->axis[AF_DIMENSION_VERT];
AF_LatinBlue blue = NULL;
@@ -148,7 +130,7 @@ index 3065895..214c217 100644
for ( nn = 0; nn < Axis->blue_count; nn++ )
{
-@@ -937,7 +967,12 @@
+@@ -954,7 +964,12 @@
break;
}
}
@@ -162,12 +144,12 @@ index 3065895..214c217 100644
if ( blue )
{
FT_Pos scaled;
-@@ -1056,7 +1091,13 @@
+@@ -1110,7 +1125,13 @@
/* a blue zone is only active if it is less than 3/4 pixels tall */
dist = FT_MulFix( blue->ref.org - blue->shoot.org, scale );
+
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ /* Do at low ppems ( ~< 200 ), in order to prevent fringes */
+ if ( dist <= 256 && dist >= -256 )
+#else
@@ -176,11 +158,11 @@ index 3065895..214c217 100644
{
#if 0
FT_Pos delta1;
-@@ -1107,7 +1148,12 @@
+@@ -1161,7 +1182,12 @@
delta2 = -delta2;
blue->ref.fit = FT_PIX_ROUND( blue->ref.cur );
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ /* Round to prevent fringes */
+ blue->shoot.fit = FT_PIX_ROUND( blue->ref.fit - delta2 );
+#else
@@ -189,64 +171,51 @@ index 3065895..214c217 100644
#endif
-@@ -1945,7 +1991,10 @@
+@@ -2015,7 +2041,10 @@
dist = edge->fpos - blue->shoot.org;
if ( dist < 0 )
dist = -dist;
-
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ /* round down to pixels */
+ /*dist = FT_MulFix( dist, scale ) & ~63;*/
+#endif
dist = FT_MulFix( dist, scale );
if ( dist < best_dist )
{
-@@ -2120,8 +2169,31 @@
+@@ -2190,8 +2219,17 @@
FT_Pos dist = width;
FT_Int sign = 0;
FT_Int vertical = ( dim == AF_DIMENSION_VERT );
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+-
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ FT_Int infinality_dist = 0;
+ FT_UInt autohint_snap_stem_height = 0;
-+ FT_UInt checked_autohint_snap_stem_height = 0;
-
-
-+ if ( checked_autohint_snap_stem_height == 0 )
-+ {
-+ char *autohint_snap_stem_height_env =
-+ getenv( "INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT" );
-+ if ( autohint_snap_stem_height_env != NULL )
-+ {
-+ sscanf ( autohint_snap_stem_height_env, "%u",
-+ &autohint_snap_stem_height );
-+
-+ if ( autohint_snap_stem_height > 100 )
-+ autohint_snap_stem_height = 100;
-+ else if ( autohint_snap_stem_height < 0 )
-+ autohint_snap_stem_height = 0;
-+ }
-+ checked_autohint_snap_stem_height = 1;
-+ }
++ if( ftinf ) autohint_snap_stem_height=ftinf->autohint_snap_stem_height;
++ if ( autohint_snap_stem_height > 100 )
++ autohint_snap_stem_height = 100;
++ else if ( autohint_snap_stem_height < 0 )
++ autohint_snap_stem_height = 0;
+
+ if ( autohint_snap_stem_height == 0 )
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
if ( !AF_LATIN_HINTS_DO_STEM_ADJUST( hints ) ||
axis->extra_light )
return width;
-@@ -2131,9 +2203,73 @@
+@@ -2201,9 +2239,73 @@
dist = -width;
sign = 1;
}
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ /* Calculate snap value differently than standard freetype */
+ if ( autohint_snap_stem_height > 0 &&
+ ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
+ ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ) )
+ {
-+ infinality_dist = af_latin_snap_width( axis->widths,
++ infinality_dist = af_latin_snap_width( axis->widths,
+ axis->width_count, dist );
-
-- if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
++
+ if ( metrics->root.scaler.face->size->metrics.x_ppem > 9 &&
+ axis->width_count > 0 &&
+ abs( axis->widths[0].cur - infinality_dist ) < 32 &&
@@ -301,14 +270,15 @@ index 3065895..214c217 100644
+ ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
+ ( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) ) )
+#else
-+
+
+- if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
+ if ( ( vertical && !AF_LATIN_HINTS_DO_VERT_SNAP( hints ) ) ||
( !vertical && !AF_LATIN_HINTS_DO_HORZ_SNAP( hints ) ) )
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
{
/* smooth hinting process: very lightly quantize the stem width */
-@@ -2193,6 +2329,9 @@
+@@ -2263,6 +2365,9 @@
}
}
else
@@ -318,23 +288,23 @@ index 3065895..214c217 100644
{
/* strong hinting process: snap the stem width to integer pixels */
-@@ -2200,7 +2339,10 @@
+@@ -2270,7 +2375,10 @@
dist = af_latin_snap_width( axis->widths, axis->width_count, dist );
-
+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ if ( autohint_snap_stem_height > 0 )
++ if ( autohint_snap_stem_height > 0 )
+ goto Done_Width;
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
if ( vertical )
{
/* in the case of vertical hinting, always round */
-@@ -2263,6 +2405,32 @@
+@@ -2333,6 +2441,32 @@
}
Done_Width:
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ if ( axis->widths[0].cur > 42 )
+ /* weighted average */
+ dist = (dist * ( 100 - autohint_snap_stem_height )
@@ -363,7 +333,7 @@ index 3065895..214c217 100644
if ( sign )
dist = -dist;
-@@ -2284,6 +2452,8 @@
+@@ -2354,6 +2488,8 @@
base_edge->flags,
stem_edge->flags );
@@ -372,41 +342,21 @@ index 3065895..214c217 100644
stem_edge->pos = base_edge->pos + fitted_width;
-@@ -2844,8 +3014,32 @@
+@@ -2915,8 +3051,11 @@
int dim;
AF_LatinAxis axis;
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+-
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ FT_Int emboldening_strength = 0;
-+ FT_Bool checked_use_various_tweaks_env = FALSE;
+ FT_Bool use_various_tweaks = FALSE;
-
--
-+ if ( !checked_use_various_tweaks_env )
-+ {
-+ char *use_various_tweaks_env =
-+ getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
-+ if ( use_various_tweaks_env != NULL )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "true") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "1") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "on") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "yes") == 0 )
-+ use_various_tweaks = TRUE;
-+ }
-+ }
-+ checked_use_various_tweaks_env = TRUE;
-+ }
++ if( ftinf ) use_various_tweaks=ftinf->use_various_tweaks;
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
error = af_glyph_hints_reload( hints, outline );
if ( error )
goto Exit;
-@@ -2913,7 +3107,11 @@
+@@ -2986,7 +3125,11 @@
}
af_glyph_hints_save( hints, outline );
@@ -420,7 +370,7 @@ index 3065895..214c217 100644
return error;
}
diff --git a/src/autofit/aflatin.h b/src/autofit/aflatin.h
-index 6855492..736f251 100644
+index dd75ef3..257265e 100644
--- a/src/autofit/aflatin.h
+++ b/src/autofit/aflatin.h
@@ -62,6 +62,9 @@ FT_BEGIN_HEADER
@@ -433,80 +383,2238 @@ index 6855492..736f251 100644
#define AF_LATIN_BLUE_ACTIVE ( 1U << 0 ) /* zone height is <= 3/4px */
#define AF_LATIN_BLUE_TOP ( 1U << 1 ) /* we have a top blue zone */
+diff --git a/src/base/Jamfile b/src/base/Jamfile
+index e39fb09..a33e9a1 100644
+--- a/src/base/Jamfile
++++ b/src/base/Jamfile
+@@ -55,6 +55,7 @@ SubDir FT2_TOP $(FT2_SRC_DIR) base ;
+ ftglyph
+ ftgxval
+ ftinit
++ ftinf
+ ftlcdfil
+ ftmm
+ ftotval
+diff --git a/src/base/ftbase.c b/src/base/ftbase.c
+index 253dfb7..59d2d17 100644
+--- a/src/base/ftbase.c
++++ b/src/base/ftbase.c
+@@ -33,6 +33,9 @@
+ #include "ftstream.c"
+ #include "fttrigon.c"
+ #include "ftutil.c"
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "ftinf.c"
++#endif
+
+ #ifdef FT_MACINTOSH
+ #include "ftmac.c"
+diff --git a/src/base/ftinf.c b/src/base/ftinf.c
+new file mode 100644
+index 0000000..cef285d
+--- /dev/null
++++ b/src/base/ftinf.c
+@@ -0,0 +1,359 @@
++#include <stdlib.h>
++#include "ftinf.h"
++#define true 1
++#define false 0
++
++#define on 1
++#define off 0
++#define end (-128)
++
++#define sw2pv 18 /* STEM_WIDTH_2_PPEM */
++#define maxp 100 /* MAX_PPEM */
++
++typedef signed char pv; /* ppm and values type */
++/* the arrays start with existence flag + values */
++typedef struct sa_rules_s {
++ const char *name;
++ pv always_use_100[1+4+1];
++ pv brightness[1+2+1];
++ pv contrast[1+2+1];
++ pv edge_detection[1+4+1];
++ pv m[1+4+1];
++ pv bearing_correction[1+2+1];
++ pv spacing[1+5+1];
++ pv start[1+5+1];
++ pv stem_scaling[1+6+1];
++ pv stem_translating[1+2+1];
++ pv stem_translating_only[1+10+1];
++ pv stem_widths[1+4]; /* these end with maxp */
++ pv synthesize_stems[1+2+1];
++} sa_rules_t;
++
++#pragma GCC diagnostic ignored "-Wpedantic" /* C99 struct initializer tags are needed */
++#pragma GCC diagnostic ignored "-Wunused-function"
++
++const ftinf_t *ftinf;
++/* final settings, updated from environment */
++ftinf_t _env;
++
++/* rules and hashing function */
++#include "ftinf_rh.c"
++
++/* rules selection */
++void ftinf_fill_stem_values( Stem_Data *stem_values,
++ const char *family, int ppem, int use_known ){
++ /* set the defaults */
++ stem_values->bearing_correction = TRUE;
++ stem_values->brightness = 0.0;
++ stem_values->contrast = 0.0;
++ stem_values->edge_detection = FALSE;
++ stem_values->m = -1;
++ stem_values->stem_scaling = -1;
++ stem_values->stem_spacing = -1;
++ stem_values->stem_start = -1;
++ stem_values->stem_translating = 0;
++ stem_values->stem_translating_only = -1024;
++ stem_values->stem_width = -1;
++ stem_values->synth_stems = FALSE;
++ stem_values->use_100 = FALSE;
++ /* pick from known rules if requested and they exist for current family */
++ if( !use_known )
++ return;
++ else {
++ const sa_rules_t *r=ftinf_rules( family );
++ int i;
++ if( r==NULL ) return;
++ if( r->stem_widths[0]==on )
++ for( i=1; r->stem_widths[i]!=maxp; ++i )
++ if( ppem < r->stem_widths[i] ){
++ stem_values->stem_width = i-1;
++ break;
++ }
++
++ if( r->stem_scaling[0]==on )
++ for( i=1; r->stem_scaling[i]!=end; i+=2 )
++ if( ppem==r->stem_scaling[i] ){
++ stem_values->stem_scaling = r->stem_scaling[i+1];
++ break;
++ }
++
++ if( r->m[0]==on )
++ for( i=1; r->m[i]!=end; i+=2 )
++ if( ppem==r->m[i] ){
++ stem_values->m = r->m[i+1];
++ break;
++ }
++
++ if( r->stem_translating_only[0]==on )
++ for( i=1; r->stem_translating_only[i]!=end; i+=2 )
++ if( ppem==r->stem_translating_only[i] || r->stem_translating_only[i]==0 ){
++ stem_values->stem_translating_only = r->stem_translating_only[i+1];
++ break;
++ }
++
++ if( r->stem_translating[0]==on )
++ for( i=1; r->stem_translating[i]!=end; i+=2 )
++ if( ppem==r->stem_translating[i] || r->stem_translating[i]==0 ){
++ stem_values->stem_translating = r->stem_translating[i+1];
++ break;
++ }
++
++ if( r->always_use_100[0]==on )
++ for( i=1; r->always_use_100[i]!=end; i+=2 )
++ if( ppem>=r->always_use_100[i] && ppem<=r->always_use_100[i+1] ){
++ stem_values->use_100 = TRUE;
++ break;
++ }
++
++ if( r->synthesize_stems[0]==on )
++ for( i=1; r->synthesize_stems[i]!=end; i+=2 )
++ if( ppem>=r->synthesize_stems[i] && ppem<=r->synthesize_stems[i+1] ){
++ stem_values->synth_stems = TRUE;
++ break;
++ }
++
++ if( r->edge_detection[0]==on )
++ for( i=1; r->edge_detection[i]!=end; i+=2 )
++ if( ppem>=r->edge_detection[i] && ppem<=r->edge_detection[i+1] ){
++ stem_values->edge_detection = TRUE;
++ break;
++ }
++
++ if( r->bearing_correction[0]==on )
++ for( i=1; r->bearing_correction[i]!=end; i+=2 )
++ if( ppem>=r->bearing_correction[i] && ppem<=r->bearing_correction[i+1] ){
++ stem_values->bearing_correction = FALSE;
++ break;
++ }
++
++#if(0)
++ if( r->brightness[0]==on )
++ for( i=1; r->brightness[i]!=end; i+=2 )
++ if( ppem==r->brightness[i]||r->brightness[i]==0 ){
++ stem_values->brightness=r->brightness[i+1]*(1.0f/300.0f);
++ break;
++ }
++
++ if( r->contrast[0]==on )
++ for( i=1; r->contrast[i]!=end; i+=2 )
++ if( ppem==r->contrast[i]||r->contrast[i]==0 ){
++ stem_values->contrast=r->contrast[i+1]*(1.0f/300.0f);
++ break;
++ }
++ if( r->spacing[0]==on ){
++ /* not used by original code */
++ }
++ if( r->start[0]==on ){
++ /* not used by original code */
++ }
++#endif
++ }
++ return;
++}
++
++void ftinf_get_bc( const char *family, int ppem, float *brightness, float *contrast ){
++ const sa_rules_t *r=ftinf_rules( family );
++ *brightness=0;
++ *contrast=0;
++ if( r ){
++ int i;
++ if( r->brightness[0]==on )
++ for( i=1; r->brightness[i]!=end; i+=2 )
++ if( ppem==r->brightness[i]||r->brightness[i]==0 ){
++ *brightness=r->brightness[i+1]*(1.0f/300.0f);
++ break;
++ }
++
++ if( r->contrast[0]==on )
++ for( i=1; r->contrast[i]!=end; i+=2 )
++ if( ppem==r->contrast[i]||r->contrast[i]==0 ){
++ *contrast=r->contrast[i+1]*(1.0f/300.0f);
++ break;
++ }
++ }
++ return;
++}
++
++static int
++bool_val( const char *s ){
++ if ( s != NULL )
++ return strcasecmp(s, "true") == 0
++ || strcasecmp(s, "1") == 0
++ || strcasecmp(s, "on") == 0
++ || strcasecmp(s, "yes") ==0;
++ else
++ return 0;
++}
++
++static int
++int_val( const char *s, int min, int max ){
++ int val;
++ sscanf ( s, "%d", &val );
++ if ( val > max )
++ val = max;
++ else if ( val < min )
++ val = min;
++ return val;
++}
++
++/* settings and hashing function */
++#include "ftinf_sh.c"
++
++/*
++ Get active Infinality settings
++ */
++void ftinf_env(){
++ const char *s;
++ ftinf=ftinf_settings( getenv( "INFINALITY_FT" ) );
++
++ if( ftinf==NULL ){
++ ftinf=ftinf_settings( "ultimate3" );
++ /* this should always succeed */
++#if(0)
++ if( ftinf==NULL ){
++ /* put an error here */
++ exit(-1);
++ }
++#endif
++ }
++ _env=ftinf[0]; /* copy as defaults */
++
++ /* check if custom environment values are set and update with them */
++ s=getenv( "INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS" );
++ if( s ) _env.autohint_increase_glyph_heights=bool_val( s );
++ s=getenv( "INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT" );
++ if( s ) _env.autohint_snap_stem_height=int_val( s, 0, 100 );
++ s=getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
++ if( s ) _env.use_various_tweaks=bool_val( s );
++ s=getenv( "INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS" );
++ if( s ) _env.use_known_settings_on_selected_fonts=bool_val(s);
++#if(0) /* not used (naming error also) */
++ s=getenv( "INFINALITY_FT_AUTOHINT_MINIMUM_STEM_WIDTH" );
++ if( s ) _env.autohint_minimum_stem_height=int_val( s, 0, 100 );
++#endif
++ s=getenv( "INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE" );
++ if( s ) sscanf( s, "%d", &_env.stem_snapping_sliding_scale );
++ s=getenv( "INFINALITY_FT_STEM_ALIGNMENT_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.stem_alignment_strength );
++ s=getenv( "INFINALITY_FT_STEM_FITTING_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.stem_fitting_strength );
++ s=getenv( "INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH" );
++ if( s ) _env.chromeos_style_sharpening_strength=int_val( s, 0, 100 );
++ s=getenv( "INFINALITY_FT_BRIGHTNESS" );
++ if( s ) sscanf( s, "%d", &_env.brightness );
++ s=getenv( "INFINALITY_FT_CONTRAST" );
++ if( s ) sscanf( s, "%d", &_env.contrast );
++ s=getenv( "INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH" );
++ if( s ) _env.windows_style_sharpening_strength=int_val( s, 0, 100 );
++ s=getenv( "INFINALITY_FT_GAMMA_CORRECTION" );
++ if( s ){
++ float *f=_env.gamma_correction;
++ sscanf ( s, "%f %f", &f[0], &f[1] );
++ if( f[1] < 1.0f ) f[1]=1.0f;
++ }
++ s=getenv( "INFINALITY_FT_FRINGE_FILTER_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.fringe_filter_strength );
++ s=getenv( "INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.grayscale_filter_strength );
++ s=getenv( "INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.autohint_horizontal_stem_darken_strength );
++ s=getenv( "INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH" );
++ if( s ) sscanf( s, "%d", &_env.autohint_vertical_stem_darken_strength );
++ s=getenv( "INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE" );
++ if( s ) sscanf( s, "%d", &_env.global_embolden_x_value );
++ s=getenv( "INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE" );
++ if( s ) sscanf( s, "%d", &_env.global_embolden_y_value );
++ s=getenv( "INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE" );
++ if( s ) sscanf( s, "%d", &_env.bold_embolden_x_value );
++ s=getenv( "INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE" );
++ if( s ) sscanf( s, "%d", &_env.bold_embolden_y_value );
++ s=getenv( "INFINALITY_FT_FILTER_PARAMS" );
++ if( s ) {
++ int *f=_env.filter_params;
++ if( sscanf( s, "%d %d %d %d %d", f+1, f+2, f+3, f+4, f+5 )==5 )
++ f[0]=on;
++ else
++ f[0]=off; /* FIXME: put a warning? */
++ }
++ /* do the range verifications as in original code */
++ if ( _env.stem_snapping_sliding_scale > maxp )
++ _env.stem_snapping_sliding_scale = 0;
++ else if ( _env.stem_snapping_sliding_scale < 0 )
++ _env.stem_snapping_sliding_scale = 0;
++ if (_env.stem_snapping_sliding_scale < 11 &&
++ _env.stem_snapping_sliding_scale > 0 )
++ _env.stem_snapping_sliding_scale = 11;
++
++ if ( _env.stem_alignment_strength > 100 )
++ _env.stem_alignment_strength = 100;
++ else if ( _env.stem_alignment_strength < 0 )
++ _env.stem_alignment_strength = 0;
++
++ if ( _env.stem_fitting_strength > 100 )
++ _env.stem_fitting_strength = 100;
++ else if ( _env.stem_fitting_strength < 0 )
++ _env.stem_fitting_strength = 0;
++
++ if ( _env.chromeos_style_sharpening_strength > 100 )
++ _env.chromeos_style_sharpening_strength = 100;
++ else if ( _env.chromeos_style_sharpening_strength < 0 )
++ _env.chromeos_style_sharpening_strength = 0;
++
++ if ( _env.brightness > 100 )
++ _env.brightness = 100;
++ else if ( _env.brightness < -100 )
++ _env.brightness = 0;
++
++ if ( _env.contrast > 100 )
++ _env.contrast = 100;
++ else if ( _env.contrast < -100 )
++ _env.contrast = 0;
++
++ if ( _env.windows_style_sharpening_strength > 100 )
++ _env.windows_style_sharpening_strength = 100;
++ else if ( _env.windows_style_sharpening_strength < 0 )
++ _env.windows_style_sharpening_strength = 0;
++
++ if ( _env.fringe_filter_strength > 100 )
++ _env.fringe_filter_strength = 100;
++ else if ( _env.fringe_filter_strength < 0 )
++ _env.fringe_filter_strength = 0;
++
++ if ( _env.grayscale_filter_strength > 100 )
++ _env.grayscale_filter_strength = 100;
++ else if ( _env.grayscale_filter_strength < 0 )
++ _env.grayscale_filter_strength = 0;
++
++ if ( _env.autohint_horizontal_stem_darken_strength > 100 )
++ _env.autohint_horizontal_stem_darken_strength = 100;
++ else if ( _env.autohint_horizontal_stem_darken_strength < 0 )
++ _env.autohint_horizontal_stem_darken_strength = 0;
++
++ if ( _env.autohint_vertical_stem_darken_strength > 100 )
++ _env.autohint_vertical_stem_darken_strength = 100;
++ else if ( _env.autohint_horizontal_stem_darken_strength < 0 )
++ _env.autohint_vertical_stem_darken_strength = 0;
++
++ if ( _env.global_embolden_x_value > 128 )
++ _env.global_embolden_x_value = 128;
++ else if ( _env.global_embolden_x_value < -128 )
++ _env.global_embolden_x_value = -128;
++
++ if ( _env.global_embolden_y_value > 128 )
++ _env.global_embolden_y_value = 128;
++ else if ( _env.global_embolden_y_value < -128 )
++ _env.global_embolden_y_value = -128;
++
++ if ( _env.bold_embolden_x_value > 128 )
++ _env.bold_embolden_x_value = 128;
++ else if (_env.bold_embolden_x_value < -128 )
++ _env.bold_embolden_x_value = -128;
++
++ if ( _env.bold_embolden_y_value > 128 )
++ _env.bold_embolden_y_value = 128;
++ else if ( _env.bold_embolden_y_value < -128 )
++ _env.bold_embolden_y_value = -128;
++
++ /* point to the combined and checked settings */
++ ftinf=&_env;
++}
+diff --git a/src/base/ftinf.h b/src/base/ftinf.h
+new file mode 100644
+index 0000000..dc35f48
+--- /dev/null
++++ b/src/base/ftinf.h
+@@ -0,0 +1,64 @@
++#ifndef _FTINF_H_
++#define _FTINF_H_
++/*
++ Stem snapping rules
++ (base freetype typedefs assumed already included)
++ */
++typedef struct
++{
++ FT_Int stem_width;
++ FT_Int stem_spacing;
++ FT_Int stem_start;
++ FT_Int stem_scaling;
++ FT_Int stem_translating_only;
++ FT_Int stem_translating;
++ float brightness;
++ float contrast;
++ FT_Bool use_100;
++ FT_Bool synth_stems;
++ FT_Bool edge_detection;
++ FT_Bool bearing_correction;
++ FT_Int m;
++} Stem_Data;
++
++/*
++ Infinality settings
++ */
++typedef struct ftinf_s {
++ const char *name;
++ int autohint_horizontal_stem_darken_strength;
++ int autohint_snap_stem_height;
++ int autohint_increase_glyph_heights;
++ int autohint_vertical_stem_darken_strength;
++ int bold_embolden_x_value;
++ int bold_embolden_y_value;
++ int brightness;
++ int chromeos_style_sharpening_strength;
++ int contrast;
++ int filter_params[6]; /* 1st one used as existence flag */
++ int fringe_filter_strength;
++ float gamma_correction[2];
++ int global_embolden_x_value;
++ int global_embolden_y_value;
++ int grayscale_filter_strength;
++ int stem_alignment_strength;
++ int stem_fitting_strength;
++ int stem_snapping_sliding_scale;
++ int use_known_settings_on_selected_fonts;
++ int use_various_tweaks;
++ int windows_style_sharpening_strength;
++} ftinf_t;
++
++extern FT_Pos infinality_cur_width; /* defined in aflatin.c */
++
++extern const ftinf_t *ftinf; /* active settings */
++
++extern void ftinf_fill_stem_values( Stem_Data *stem_values,
++ const char *family, int ppem, int use_known );
++extern void ftinf_get_bc( const char *family, int ppem,
++ float *brightness, float *contrast );
++
++/* get values from environment (FIXME: maybe update with using user files) */
++extern void ftinf_env();
++
++#endif
+diff --git a/src/base/ftinf_rh.c b/src/base/ftinf_rh.c
+new file mode 100644
+index 0000000..4cd6f1a
+--- /dev/null
++++ b/src/base/ftinf_rh.c
+@@ -0,0 +1,628 @@
++/* ANSI-C code produced by gperf version 3.1 */
++/* Command-line: gperf ftinf_rh.gperf */
++/* Computed positions: -k'1,$' */
++
++#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
++ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
++ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
++ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
++ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
++ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
++ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
++ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
++ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
++ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
++ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
++ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
++ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
++ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
++ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
++ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
++ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
++ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
++ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
++ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
++ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
++ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
++ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
++/* The character set is not based on ISO-646. */
++#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
++#endif
++
++#line 9 "ftinf_rh.gperf"
++
++#include <ctype.h>
++static const struct sa_rules_s* _rules_get( const char*str, unsigned len );
++/* maximum key range = 82, duplicates = 0 */
++
++#ifdef __GNUC__
++__inline
++#else
++#ifdef __cplusplus
++inline
++#endif
++#endif
++static unsigned int
++_rules_hash (register const char *str, register unsigned int len)
++{
++ static const unsigned char asso_values[] =
++ {
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 0, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 5, 45, 5,
++ 35, 25, 35, 35, 50, 45, 85, 85, 0, 25,
++ 40, 5, 0, 85, 50, 20, 20, 0, 10, 10,
++ 85, 10, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
++ 85, 85, 85, 85, 85, 85
++ };
++ return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
++}
++
++#ifdef __GNUC__
++__inline
++#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
++#endif
++const struct sa_rules_s *
++_rules_get (register const char *str, register unsigned int len)
++{
++ enum
++ {
++ TOTAL_KEYWORDS = 58,
++ MIN_WORD_LENGTH = 3,
++ MAX_WORD_LENGTH = 24,
++ MIN_HASH_VALUE = 3,
++ MAX_HASH_VALUE = 84
++ };
++
++ static const struct sa_rules_s wordlist[] =
++ {
++#line 15 "ftinf_rh.gperf"
++{ .name="---",
++ .synthesize_stems={on, 13, 13, end}
++},
++#line 253 "ftinf_rh.gperf"
++{ .name="ubuntu",
++ .always_use_100={on, 12, 13, 15, 15, end}
++},
++#line 31 "ftinf_rh.gperf"
++{ .name="arial",
++ .always_use_100={on, 0, maxp, end},
++ .edge_detection={on, 11, 11, 13, 13, end},
++ .spacing={on, 10, 11, 23, 25, 30, end},
++ .start={on, 11, 18, 23, 30, 30, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, 16, -24, end}
++},
++#line 87 "ftinf_rh.gperf"
++{ .name="corbel",
++ .stem_translating_only={on, 10, 16, end},
++ .stem_widths={on, 10, 21, maxp}
++},
++#line 71 "ftinf_rh.gperf"
++{ .name="canwell",
++ .stem_scaling={on, 13, 0, end}
++},
++#line 216 "ftinf_rh.gperf"
++{ .name="pragmata",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 67 "ftinf_rh.gperf"
++{ .name="cantarell",
++ .stem_translating_only={on, 11, 0, 12, 0, end},
++ .stem_widths={on, 10, 22, maxp,}
++},
++#line 39 "ftinf_rh.gperf"
++{ .name="arimo",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 8, 8, 32, 9, 32, end}
++},
++#line 207 "ftinf_rh.gperf"
++{ .name="optima",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end},
++ .stem_scaling={on, 17, 1, end},
++ .stem_translating_only={on, 10, 0, 11, 0, 12, 0, end}
++},
++#line 63 "ftinf_rh.gperf"
++{ .name="candara",
++ .stem_scaling={on, 14, 1, 17, 1, end},
++ .stem_translating_only={on, 10, 16, end}
++},
++#line 77 "ftinf_rh.gperf"
++{ .name="comfortaa",
++ .stem_widths={on, 10, 19, 22, maxp},
++ .stem_scaling={on, 11, 0, end}
++},
++#line 161 "ftinf_rh.gperf"
++{ .name="liberation mono",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 18 "ftinf_rh.gperf"
++{ .name="andale mono",
++ .always_use_100={on, 0, maxp, end},
++ .stem_scaling={on, 11, 1, end},
++ .stem_widths={on, 10, 21, maxp,}
++},
++#line 256 "ftinf_rh.gperf"
++{ .name="verdana",
++ .always_use_100={on, 0, 14, 16, maxp, end},
++ .stem_scaling={on, 12, 1, 15, 1, end},
++ .stem_translating_only={on, 8, 16, 15, 16, 14, 32, 18, 32, 19, 24, end}
++},
++#line 74 "ftinf_rh.gperf"
++{ .name="century gothic",
++ .stem_widths={on, 10, 22, maxp,}
++},
++#line 91 "ftinf_rh.gperf"
++{ .name="courier new",
++ .always_use_100={on, 12, 12, end},
++ .edge_detection={on, 10, 12, end},
++ .m={on, 13, 1, 14, 1, end}
++},
++#line 23 "ftinf_rh.gperf"
++{ .name="arial narrow",
++ .stem_widths={on, 10, 21, maxp,}
++},
++#line 185 "ftinf_rh.gperf"
++{ .name="luxi sans",
++ .always_use_100={on, 13, 13, end},
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++#line 225 "ftinf_rh.gperf"
++{ .name="samba",
++ .stem_scaling={on, 11, 0, end}
++},
++#line 233 "ftinf_rh.gperf"
++{ .name="tahoma",
++ .always_use_100={on, 11, 11, 14, maxp, end},
++ .edge_detection={on, 11, 11, end},
++ .spacing={on, 10, 12, 18, 18, 30, end},
++ .start={on, 14, 17, 30, 100, 100, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 7, 32, 8, 32, 9, 32, end},
++},
++#line 164 "ftinf_rh.gperf"
++{ .name="liberation sans narrow",
++ .stem_widths={on,10, 22, maxp,}
++},
++#line 81 "ftinf_rh.gperf"
++{ .name="consolas",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 8, 32, 9, 32, end},
++ .stem_widths={on, 10, 20, maxp,},
++ .stem_scaling={on, 11, 1, end}
++},
++#line 203 "ftinf_rh.gperf"
++{ .name="open sans",
++ .stem_translating_only={on, 10, 16, 9, 16, end},
++ .stem_widths={on, 10, 20, maxp,}
++},
++#line 167 "ftinf_rh.gperf"
++{ .name="liberation sans",
++ .edge_detection={on, 11, 11, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 8, 8, 32, 9, 32, end},
++ .stem_widths={on,10, 19, maxp,}
++},
++#line 193 "ftinf_rh.gperf"
++{ .name="monaco",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 101 "ftinf_rh.gperf"
++{ .name="cousine",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 176 "ftinf_rh.gperf"
++{ .name="lucida grande",
++ .stem_scaling={on, 13, 1, end},
++ .stem_translating_only={on, 13, 24, 14, 24, 8, 16, 9, 16, end},
++ .stem_widths={on, 10, 16, sw2pv, maxp},
++},
++#line 173 "ftinf_rh.gperf"
++{ .name="lucida console",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 196 "ftinf_rh.gperf"
++{ .name="myriad pro",
++ .stem_scaling={on, 14, 1, 17, 1, end},
++ .stem_translating_only={on, 10, 16, 11, 0, 9, 16, end}
++},
++#line 26 "ftinf_rh.gperf"
++{ .name="arial unicode ms",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, end}
++},
++#line 213 "ftinf_rh.gperf"
++{ .name="palatino linotype",
++ .edge_detection={on, 0, 100, end}
++},
++#line 181 "ftinf_rh.gperf"
++{ .name="lucida sans unicode",
++ .stem_translating_only={on, 13, 24, 14, 24, 8, 16, 9, 16, end},
++ .stem_widths={on,10, 16, sw2pv, maxp,}
++},
++#line 140 "ftinf_rh.gperf"
++{ .name="futura",
++ .stem_widths={on, 10, 14, sw2pv, maxp,}
++},
++#line 147 "ftinf_rh.gperf"
++{ .name="georgia",
++ .stem_translating_only={on, 13, 16, 14, 16, 15, 0, end}
++},
++#line 125 "ftinf_rh.gperf"
++{ .name="freemono",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 200 "ftinf_rh.gperf"
++{ .name="nina",
++ .stem_scaling={on, 11, 0, 12, 0, 13, 0, end}
++},
++#line 121 "ftinf_rh.gperf"
++{ .name="essential pragmatapro",
++ .always_use_100={on, 0, maxp, end},
++ .m={on, 13, 0, 14, 0, end}
++},
++#line 247 "ftinf_rh.gperf"
++{ .name="trebuchet ms",
++ .always_use_100={on, 13, 13, end},
++ .stem_scaling={on, 13, 0, 17, 0, 20, 1, end},
++ .stem_translating_only={on, 10, 16, 11, 0, 8, 32, 9, 32, end},
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++#line 114 "ftinf_rh.gperf"
++{ .name="droid sans mono",
++ .m={on, 12, 0, end}
++},
++#line 104 "ftinf_rh.gperf"
++{ .name="dejavu sans mono",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 7, 16, 8, 32, 9, 16, end}
++},
++#line 57 "ftinf_rh.gperf"
++{ .name="calibri",
++ .always_use_100={on, 23, maxp, end},
++ .stem_scaling={on, 15, 1, 17, 1, 18, 1, end},
++ .stem_translating_only={on, 10, 16, 15, 0, end},
++ .stem_widths={on, 1, 10, 19, maxp,}
++},
++#line 156 "ftinf_rh.gperf"
++{ .name="inconsolata",
++ .stem_scaling={on, 12, 1, 15, 1, end},
++ .stem_translating_only={on, 10, 24, 9, 32, end},
++ .stem_widths={on, 10, 23, maxp,},
++},
++#line 96 "ftinf_rh.gperf"
++{ .name="courier",
++ .always_use_100={on, 0, maxp, end},
++ .m={on, 13, 1, 14, 1, end},
++ .stem_translating_only={on, 13, 16, 15, 0, end}
++},
++#line 128 "ftinf_rh.gperf"
++{ .name="freesans",
++ .always_use_100={on, 0, maxp, end},
++ .edge_detection={on, 11, 11, 13, 13, end},
++ .spacing={on, 10, 12, 18, 18, 30, end},
++ .start={on, 10, 18, 18, 25, 30, end},
++ .stem_scaling={on, 16, 0, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 9, 8, end}
++},
++#line 150 "ftinf_rh.gperf"
++{ .name="gill sans",
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++#line 117 "ftinf_rh.gperf"
++{ .name="droid sans",
++ .always_use_100={on, 12, 12, 15, 15, end},
++ .stem_translating_only={on, 8, 16, 9, 16, end}
++},
++#line 108 "ftinf_rh.gperf"
++{ .name="dejavu sans",
++ .always_use_100={on, 10, 14, 16, 17, end},
++ .m={on, 12, 0, end},
++ .stem_scaling={on, 12, 1, end},
++ .stem_translating_only={on, 8, 16, 15, -20, end}
++},
++#line 219 "ftinf_rh.gperf"
++{ .name="raleway",
++ .stem_scaling={on, 15, 0, end}
++},
++#line 153 "ftinf_rh.gperf"
++{ .name="helvetica cy",
++ .stem_widths={on, 10, 23, maxp,}
++},
++#line 228 "ftinf_rh.gperf"
++{ .name="segoe ui",
++ .always_use_100={on, 11, 12, 14, 14, end},
++ .stem_translating_only={on, 10, 0, 7, 32, 8, 16, 9, 24, end},
++ .stem_widths={on, 10, 23, maxp,}
++},
++#line 48 "ftinf_rh.gperf"
++{ .name="bitstream vera sans mono",
++ .always_use_100={on, 0, maxp, end}
++},
++#line 241 "ftinf_rh.gperf"
++{ .name="times new roman",
++ .always_use_100={on, 14, 14, 16, 16, end},
++ .bearing_correction={0, 100, end},
++ .stem_scaling={on, 17, 1, end},
++ .stem_translating_only={on, 17, 8, end}
++},
++#line 222 "ftinf_rh.gperf"
++{ .name="rokkitt",
++ .stem_widths={on, 10, 21, maxp,}
++},
++#line 143 "ftinf_rh.gperf"
++{ .name="garamond",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end}
++},
++#line 137 "ftinf_rh.gperf"
++{ .name="freeserif",
++ .stem_scaling={on, 13, 1, 17, 1, end}
++},
++#line 189 "ftinf_rh.gperf"
++{ .name="microsoft sans serif",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, end}
++},
++#line 44 "ftinf_rh.gperf"
++{ .name="baskerville",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end}
++},
++#line 51 "ftinf_rh.gperf"
++{ .name="bitstream vera sans",
++ .always_use_100={on, 10, 14, 16, 17, end},
++ .m={on, 12, 0, end},
++ .stem_scaling={on ,12, 1, end},
++ .stem_translating_only={on, 8, 16, end}
++}
++ };
++
++ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
++ {
++ register int key = _rules_hash (str, len);
++
++ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
++ {
++ register const struct sa_rules_s *resword;
++
++ switch (key - 3)
++ {
++ case 0:
++ resword = &wordlist[0];
++ goto compare;
++ case 3:
++ resword = &wordlist[1];
++ goto compare;
++ case 7:
++ resword = &wordlist[2];
++ goto compare;
++ case 8:
++ resword = &wordlist[3];
++ goto compare;
++ case 9:
++ resword = &wordlist[4];
++ goto compare;
++ case 10:
++ resword = &wordlist[5];
++ goto compare;
++ case 11:
++ resword = &wordlist[6];
++ goto compare;
++ case 12:
++ resword = &wordlist[7];
++ goto compare;
++ case 13:
++ resword = &wordlist[8];
++ goto compare;
++ case 14:
++ resword = &wordlist[9];
++ goto compare;
++ case 16:
++ resword = &wordlist[10];
++ goto compare;
++ case 17:
++ resword = &wordlist[11];
++ goto compare;
++ case 18:
++ resword = &wordlist[12];
++ goto compare;
++ case 19:
++ resword = &wordlist[13];
++ goto compare;
++ case 21:
++ resword = &wordlist[14];
++ goto compare;
++ case 23:
++ resword = &wordlist[15];
++ goto compare;
++ case 24:
++ resword = &wordlist[16];
++ goto compare;
++ case 26:
++ resword = &wordlist[17];
++ goto compare;
++ case 27:
++ resword = &wordlist[18];
++ goto compare;
++ case 28:
++ resword = &wordlist[19];
++ goto compare;
++ case 29:
++ resword = &wordlist[20];
++ goto compare;
++ case 30:
++ resword = &wordlist[21];
++ goto compare;
++ case 31:
++ resword = &wordlist[22];
++ goto compare;
++ case 32:
++ resword = &wordlist[23];
++ goto compare;
++ case 33:
++ resword = &wordlist[24];
++ goto compare;
++ case 34:
++ resword = &wordlist[25];
++ goto compare;
++ case 35:
++ resword = &wordlist[26];
++ goto compare;
++ case 36:
++ resword = &wordlist[27];
++ goto compare;
++ case 37:
++ resword = &wordlist[28];
++ goto compare;
++ case 38:
++ resword = &wordlist[29];
++ goto compare;
++ case 39:
++ resword = &wordlist[30];
++ goto compare;
++ case 41:
++ resword = &wordlist[31];
++ goto compare;
++ case 43:
++ resword = &wordlist[32];
++ goto compare;
++ case 44:
++ resword = &wordlist[33];
++ goto compare;
++ case 45:
++ resword = &wordlist[34];
++ goto compare;
++ case 46:
++ resword = &wordlist[35];
++ goto compare;
++ case 48:
++ resword = &wordlist[36];
++ goto compare;
++ case 49:
++ resword = &wordlist[37];
++ goto compare;
++ case 52:
++ resword = &wordlist[38];
++ goto compare;
++ case 53:
++ resword = &wordlist[39];
++ goto compare;
++ case 54:
++ resword = &wordlist[40];
++ goto compare;
++ case 58:
++ resword = &wordlist[41];
++ goto compare;
++ case 59:
++ resword = &wordlist[42];
++ goto compare;
++ case 60:
++ resword = &wordlist[43];
++ goto compare;
++ case 61:
++ resword = &wordlist[44];
++ goto compare;
++ case 62:
++ resword = &wordlist[45];
++ goto compare;
++ case 63:
++ resword = &wordlist[46];
++ goto compare;
++ case 64:
++ resword = &wordlist[47];
++ goto compare;
++ case 69:
++ resword = &wordlist[48];
++ goto compare;
++ case 70:
++ resword = &wordlist[49];
++ goto compare;
++ case 71:
++ resword = &wordlist[50];
++ goto compare;
++ case 72:
++ resword = &wordlist[51];
++ goto compare;
++ case 74:
++ resword = &wordlist[52];
++ goto compare;
++ case 75:
++ resword = &wordlist[53];
++ goto compare;
++ case 76:
++ resword = &wordlist[54];
++ goto compare;
++ case 77:
++ resword = &wordlist[55];
++ goto compare;
++ case 78:
++ resword = &wordlist[56];
++ goto compare;
++ case 81:
++ resword = &wordlist[57];
++ goto compare;
++ }
++ return 0;
++ compare:
++ {
++ register const char *s = resword->name;
++
++ if (*str == *s && !strcmp (str + 1, s + 1))
++ return resword;
++ }
++ }
++ }
++ return 0;
++}
++#line 261 "ftinf_rh.gperf"
++
++
++static const sa_rules_t*
++ftinf_rules( const char *name ){
++ if( name ){
++ enum {
++ max_wlen=31
++ };
++ char buf[max_wlen+1];
++ int len=strlen( name );
++ if( len <= max_wlen ){
++ const sa_rules_t *p;
++ int i;
++ for( i=0; i<len; ++i )
++ buf[i]=tolower( name[i] );
++ buf[len]='\0';
++ p=_rules_get( buf, len );
++ if( p ) return p;
++ }
++ }
++ return NULL;
++}
++/*
++ gperf --output-file=ftinf_rh.c ftinf_rh.gperf
++*/
+diff --git a/src/base/ftinf_rh.gperf b/src/base/ftinf_rh.gperf
+new file mode 100644
+index 0000000..e25f9b6
+--- /dev/null
++++ b/src/base/ftinf_rh.gperf
+@@ -0,0 +1,285 @@
++%struct-type
++%define slot-name name
++%enum
++%switch=1
++%readonly-tables
++%omit-struct-type
++%define lookup-function-name _rules_get
++%define hash-function-name _rules_hash
++%{
++#include <ctype.h>
++static const struct sa_rules_s* _rules_get( const char*str, unsigned len );
++%}
++struct sa_rules_s;
++%%
++{ .name="---",
++ .synthesize_stems={on, 13, 13, end}
++},
++{ .name="andale mono",
++ .always_use_100={on, 0, maxp, end},
++ .stem_scaling={on, 11, 1, end},
++ .stem_widths={on, 10, 21, maxp,}
++},
++{ .name="arial narrow",
++ .stem_widths={on, 10, 21, maxp,}
++},
++{ .name="arial unicode ms",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, end}
++},
++{ .name="arial",
++ .always_use_100={on, 0, maxp, end},
++ .edge_detection={on, 11, 11, 13, 13, end},
++ .spacing={on, 10, 11, 23, 25, 30, end},
++ .start={on, 11, 18, 23, 30, 30, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, 16, -24, end}
++},
++{ .name="arimo",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 8, 8, 32, 9, 32, end}
++},
++{ .name="baskerville",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end}
++},
++{ .name="bitstream vera sans mono",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="bitstream vera sans",
++ .always_use_100={on, 10, 14, 16, 17, end},
++ .m={on, 12, 0, end},
++ .stem_scaling={on ,12, 1, end},
++ .stem_translating_only={on, 8, 16, end}
++},
++{ .name="calibri",
++ .always_use_100={on, 23, maxp, end},
++ .stem_scaling={on, 15, 1, 17, 1, 18, 1, end},
++ .stem_translating_only={on, 10, 16, 15, 0, end},
++ .stem_widths={on, 1, 10, 19, maxp,}
++},
++{ .name="candara",
++ .stem_scaling={on, 14, 1, 17, 1, end},
++ .stem_translating_only={on, 10, 16, end}
++},
++{ .name="cantarell",
++ .stem_translating_only={on, 11, 0, 12, 0, end},
++ .stem_widths={on, 10, 22, maxp,}
++},
++{ .name="canwell",
++ .stem_scaling={on, 13, 0, end}
++},
++{ .name="century gothic",
++ .stem_widths={on, 10, 22, maxp,}
++},
++{ .name="comfortaa",
++ .stem_widths={on, 10, 19, 22, maxp},
++ .stem_scaling={on, 11, 0, end}
++},
++{ .name="consolas",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 8, 32, 9, 32, end},
++ .stem_widths={on, 10, 20, maxp,},
++ .stem_scaling={on, 11, 1, end}
++},
++{ .name="corbel",
++ .stem_translating_only={on, 10, 16, end},
++ .stem_widths={on, 10, 21, maxp}
++},
++{ .name="courier new",
++ .always_use_100={on, 12, 12, end},
++ .edge_detection={on, 10, 12, end},
++ .m={on, 13, 1, 14, 1, end}
++},
++{ .name="courier",
++ .always_use_100={on, 0, maxp, end},
++ .m={on, 13, 1, 14, 1, end},
++ .stem_translating_only={on, 13, 16, 15, 0, end}
++},
++{ .name="cousine",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="dejavu sans mono",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 7, 16, 8, 32, 9, 16, end}
++},
++{ .name="dejavu sans",
++ .always_use_100={on, 10, 14, 16, 17, end},
++ .m={on, 12, 0, end},
++ .stem_scaling={on, 12, 1, end},
++ .stem_translating_only={on, 8, 16, 15, -20, end}
++},
++{ .name="droid sans mono",
++ .m={on, 12, 0, end}
++},
++{ .name="droid sans",
++ .always_use_100={on, 12, 12, 15, 15, end},
++ .stem_translating_only={on, 8, 16, 9, 16, end}
++},
++{ .name="essential pragmatapro",
++ .always_use_100={on, 0, maxp, end},
++ .m={on, 13, 0, 14, 0, end}
++},
++{ .name="freemono",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="freesans",
++ .always_use_100={on, 0, maxp, end},
++ .edge_detection={on, 11, 11, 13, 13, end},
++ .spacing={on, 10, 12, 18, 18, 30, end},
++ .start={on, 10, 18, 18, 25, 30, end},
++ .stem_scaling={on, 16, 0, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 16, 9, 8, end}
++},
++{ .name="freeserif",
++ .stem_scaling={on, 13, 1, 17, 1, end}
++},
++{ .name="futura",
++ .stem_widths={on, 10, 14, sw2pv, maxp,}
++},
++{ .name="garamond",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end}
++},
++{ .name="georgia",
++ .stem_translating_only={on, 13, 16, 14, 16, 15, 0, end}
++},
++{ .name="gill sans",
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++{ .name="helvetica cy",
++ .stem_widths={on, 10, 23, maxp,}
++},
++{ .name="inconsolata",
++ .stem_scaling={on, 12, 1, 15, 1, end},
++ .stem_translating_only={on, 10, 24, 9, 32, end},
++ .stem_widths={on, 10, 23, maxp,},
++},
++{ .name="liberation mono",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="liberation sans narrow",
++ .stem_widths={on,10, 22, maxp,}
++},
++{ .name="liberation sans",
++ .edge_detection={on, 11, 11, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 10, 8, 8, 32, 9, 32, end},
++ .stem_widths={on,10, 19, maxp,}
++},
++{ .name="lucida console",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="lucida grande",
++ .stem_scaling={on, 13, 1, end},
++ .stem_translating_only={on, 13, 24, 14, 24, 8, 16, 9, 16, end},
++ .stem_widths={on, 10, 16, sw2pv, maxp},
++},
++{ .name="lucida sans unicode",
++ .stem_translating_only={on, 13, 24, 14, 24, 8, 16, 9, 16, end},
++ .stem_widths={on,10, 16, sw2pv, maxp,}
++},
++{ .name="luxi sans",
++ .always_use_100={on, 13, 13, end},
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++{ .name="microsoft sans serif",
++ .always_use_100={on, 0, maxp, end},
++ .stem_translating_only={on, 10, 16, 8, 32, 9, 32, end}
++},
++{ .name="monaco",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="myriad pro",
++ .stem_scaling={on, 14, 1, 17, 1, end},
++ .stem_translating_only={on, 10, 16, 11, 0, 9, 16, end}
++},
++{ .name="nina",
++ .stem_scaling={on, 11, 0, 12, 0, 13, 0, end}
++},
++{ .name="open sans",
++ .stem_translating_only={on, 10, 16, 9, 16, end},
++ .stem_widths={on, 10, 20, maxp,}
++},
++{ .name="optima",
++ .brightness={on, 0, -20, end},
++ .contrast={on, 0, 25, end},
++ .stem_scaling={on, 17, 1, end},
++ .stem_translating_only={on, 10, 0, 11, 0, 12, 0, end}
++},
++{ .name="palatino linotype",
++ .edge_detection={on, 0, 100, end}
++},
++{ .name="pragmata",
++ .always_use_100={on, 0, maxp, end}
++},
++{ .name="raleway",
++ .stem_scaling={on, 15, 0, end}
++},
++{ .name="rokkitt",
++ .stem_widths={on, 10, 21, maxp,}
++},
++{ .name="samba",
++ .stem_scaling={on, 11, 0, end}
++},
++{ .name="segoe ui",
++ .always_use_100={on, 11, 12, 14, 14, end},
++ .stem_translating_only={on, 10, 0, 7, 32, 8, 16, 9, 24, end},
++ .stem_widths={on, 10, 23, maxp,}
++},
++{ .name="tahoma",
++ .always_use_100={on, 11, 11, 14, maxp, end},
++ .edge_detection={on, 11, 11, end},
++ .spacing={on, 10, 12, 18, 18, 30, end},
++ .start={on, 14, 17, 30, 100, 100, end},
++ .stem_translating={on, 11, 32, end},
++ .stem_translating_only={on, 7, 32, 8, 32, 9, 32, end},
++},
++{ .name="times new roman",
++ .always_use_100={on, 14, 14, 16, 16, end},
++ .bearing_correction={0, 100, end},
++ .stem_scaling={on, 17, 1, end},
++ .stem_translating_only={on, 17, 8, end}
++},
++{ .name="trebuchet ms",
++ .always_use_100={on, 13, 13, end},
++ .stem_scaling={on, 13, 0, 17, 0, 20, 1, end},
++ .stem_translating_only={on, 10, 16, 11, 0, 8, 32, 9, 32, end},
++ .stem_widths={on, 10, 17, sw2pv, maxp,}
++},
++{ .name="ubuntu",
++ .always_use_100={on, 12, 13, 15, 15, end}
++},
++{ .name="verdana",
++ .always_use_100={on, 0, 14, 16, maxp, end},
++ .stem_scaling={on, 12, 1, 15, 1, end},
++ .stem_translating_only={on, 8, 16, 15, 16, 14, 32, 18, 32, 19, 24, end}
++},
++%%
++
++static const sa_rules_t*
++ftinf_rules( const char *name ){
++ if( name ){
++ enum {
++ max_wlen=31
++ };
++ char buf[max_wlen+1];
++ int len=strlen( name );
++ if( len <= max_wlen ){
++ const sa_rules_t *p;
++ int i;
++ for( i=0; i<len; ++i )
++ buf[i]=tolower( name[i] );
++ buf[len]='\0';
++ p=_rules_get( buf, len );
++ if( p ) return p;
++ }
++ }
++ return NULL;
++}
++/*
++ gperf --output-file=ftinf_rh.c ftinf_rh.gperf
++*/
+diff --git a/src/base/ftinf_sh.c b/src/base/ftinf_sh.c
+new file mode 100644
+index 0000000..7fc2222
+--- /dev/null
++++ b/src/base/ftinf_sh.c
+@@ -0,0 +1,465 @@
++/* ANSI-C code produced by gperf version 3.1 */
++/* Command-line: gperf ftinf_sh.gperf */
++/* Computed positions: -k'1,$' */
++
++#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
++ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
++ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
++ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
++ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
++ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
++ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
++ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
++ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
++ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
++ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
++ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
++ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
++ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
++ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
++ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
++ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
++ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
++ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
++ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
++ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
++ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
++ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
++/* The character set is not based on ISO-646. */
++#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
++#endif
++
++#line 9 "ftinf_sh.gperf"
++
++#include <ctype.h>
++static const struct ftinf_s* _settings_get( const char*str, unsigned len);
++/* maximum key range = 37, duplicates = 0 */
++
++#ifdef __GNUC__
++__inline
++#else
++#ifdef __cplusplus
++inline
++#endif
++#endif
++static unsigned int
++_settings_hash (register const char *str, register unsigned int len)
++{
++ static const unsigned char asso_values[] =
++ {
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 13,
++ 8, 30, 25, 20, 40, 10, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 5, 40, 0,
++ 0, 0, 40, 40, 10, 0, 40, 40, 15, 5,
++ 10, 0, 10, 40, 40, 0, 0, 0, 0, 0,
++ 0, 0, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
++ 40, 40, 40, 40, 40, 40
++ };
++ return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
++}
++
++#ifdef __GNUC__
++__inline
++#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
++__attribute__ ((__gnu_inline__))
++#endif
++#endif
++const struct ftinf_s *
++_settings_get (register const char *str, register unsigned int len)
++{
++ enum
++ {
++ TOTAL_KEYWORDS = 22,
++ MIN_WORD_LENGTH = 3,
++ MAX_WORD_LENGTH = 14,
++ MIN_HASH_VALUE = 3,
++ MAX_HASH_VALUE = 39
++ };
++
++ static const struct ftinf_s wordlist[] =
++ {
++#line 76 "ftinf_sh.gperf"
++{ .name="osx",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .bold_embolden_x_value=16,
++ .brightness=10,
++ .contrast=20,
++ .filter_params={on, 3, 32, 38, 32, 3},
++ .gamma_correction={1000, 80},
++ .global_embolden_y_value=8,
++ .grayscale_filter_strength=25,
++},
++#line 37 "ftinf_sh.gperf"
++{ .name="ipad",
++ .filter_params={on, 0, 0, 100, 0, 0},
++ .gamma_correction={1000, 80},
++ .grayscale_filter_strength=100
++},
++#line 114 "ftinf_sh.gperf"
++{ .name="shove",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=100,
++ .stem_fitting_strength=100,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++#line 126 "ftinf_sh.gperf"
++{ .name="ubuntu",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=-10,
++ .contrast=15,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={1000, 80},
++ .use_various_tweaks=true
++},
++#line 27 "ftinf_sh.gperf"
++{ .name="classic",
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .filter_params={on, 6, 25, 38, 25, 6},
++ .gamma_correction={0, 100},
++ .use_various_tweaks=true
++},
++#line 34 "ftinf_sh.gperf"
++{ .name="disabled",
++ .gamma_correction={0, 100},
++},
++#line 100 "ftinf_sh.gperf"
++{ .name="sharpened",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=25,
++ .stem_snapping_sliding_scale=40,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++#line 42 "ftinf_sh.gperf"
++{ .name="infinality",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=25,
++ .stem_snapping_sliding_scale=40,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=5
++},
++#line 15 "ftinf_sh.gperf"
++{ .name="custom",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 8, 24, 48, 24, 8},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=75,
++ .stem_fitting_strength=50,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++#line 180 "ftinf_sh.gperf"
++{ .name="vanilla",
++ .filter_params={on, 6, 25, 38, 25, 6},
++ .gamma_correction={0, 100},
++},
++#line 184 "ftinf_sh.gperf"
++{ .name="windows7light",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .contrast=20,
++ .filter_params={on, 20, 25, 38, 25, 05},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 160},
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=100
++},
++#line 226 "ftinf_sh.gperf"
++{ .name="windowsxplight",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=20,
++ .contrast=30,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 120},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++#line 64 "ftinf_sh.gperf"
++{ .name="nudge",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_various_tweaks=true,
++},
++#line 144 "ftinf_sh.gperf"
++{ .name="ultimate2",
++ .filter_params={on, 6, 22, 36, 22, 6},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++#line 197 "ftinf_sh.gperf"
++{ .name="windows7",
++ .filter_params={on, 20, 25, 42, 25, 06},
++ .fringe_filter_strength=100,
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .windows_style_sharpening_strength=65,
++ .gamma_correction={1000, 120},
++ .brightness=10,
++ .contrast=20,
++ .use_various_tweaks=true,
++ .autohint_snap_stem_height=100,
++ .use_known_settings_on_selected_fonts=true,
++},
++#line 210 "ftinf_sh.gperf"
++{ .name="windowsxp",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=10,
++ .contrast=20,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 120},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++#line 56 "ftinf_sh.gperf"
++{ .name="linux",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .gamma_correction={0, 100},
++ .use_various_tweaks=true
++},
++#line 135 "ftinf_sh.gperf"
++{ .name="ultimate1",
++ .filter_params={on, 4, 22, 38, 22, 4},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++#line 87 "ftinf_sh.gperf"
++{ .name="push",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=75,
++ .stem_fitting_strength=50,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++#line 171 "ftinf_sh.gperf"
++{ .name="ultimate5",
++ .filter_params={on, 12, 28, 42, 28, 12},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++#line 162 "ftinf_sh.gperf"
++{ .name="ultimate4",
++ .filter_params={on, 10, 25, 37, 25, 10},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++#line 153 "ftinf_sh.gperf"
++{ .name="ultimate3",
++ .filter_params={on, 8, 24, 36, 24, 8},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++}
++ };
++
++ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
++ {
++ register int key = _settings_hash (str, len);
++
++ if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
++ {
++ register const struct ftinf_s *resword;
++
++ switch (key - 3)
++ {
++ case 0:
++ resword = &wordlist[0];
++ goto compare;
++ case 1:
++ resword = &wordlist[1];
++ goto compare;
++ case 2:
++ resword = &wordlist[2];
++ goto compare;
++ case 3:
++ resword = &wordlist[3];
++ goto compare;
++ case 4:
++ resword = &wordlist[4];
++ goto compare;
++ case 5:
++ resword = &wordlist[5];
++ goto compare;
++ case 6:
++ resword = &wordlist[6];
++ goto compare;
++ case 7:
++ resword = &wordlist[7];
++ goto compare;
++ case 8:
++ resword = &wordlist[8];
++ goto compare;
++ case 9:
++ resword = &wordlist[9];
++ goto compare;
++ case 10:
++ resword = &wordlist[10];
++ goto compare;
++ case 11:
++ resword = &wordlist[11];
++ goto compare;
++ case 12:
++ resword = &wordlist[12];
++ goto compare;
++ case 14:
++ resword = &wordlist[13];
++ goto compare;
++ case 15:
++ resword = &wordlist[14];
++ goto compare;
++ case 16:
++ resword = &wordlist[15];
++ goto compare;
++ case 17:
++ resword = &wordlist[16];
++ goto compare;
++ case 19:
++ resword = &wordlist[17];
++ goto compare;
++ case 21:
++ resword = &wordlist[18];
++ goto compare;
++ case 26:
++ resword = &wordlist[19];
++ goto compare;
++ case 31:
++ resword = &wordlist[20];
++ goto compare;
++ case 36:
++ resword = &wordlist[21];
++ goto compare;
++ }
++ return 0;
++ compare:
++ {
++ register const char *s = resword->name;
++
++ if (*str == *s && !strcmp (str + 1, s + 1))
++ return resword;
++ }
++ }
++ }
++ return 0;
++}
++#line 242 "ftinf_sh.gperf"
++
++
++static const ftinf_t*
++ftinf_settings( const char *name ){
++ if( name ){
++ enum {
++ max_wlen=31
++ };
++ char buf[max_wlen+1];
++ int len=strlen( name );
++ if( len <= max_wlen ){
++ const ftinf_t *p;
++ int i;
++ for( i=0; i<len; ++i )
++ buf[i]=tolower( name[i] );
++ buf[len]='\0';
++ p=_settings_get( buf, len );
++ if( p ) return p;
++ }
++ }
++ return NULL;
++}
++/*
++ gperf --output-file=ftinf_sh.c ftinf_sh.gperf
++*/
+diff --git a/src/base/ftinf_sh.gperf b/src/base/ftinf_sh.gperf
+new file mode 100644
+index 0000000..ba5fc0a
+--- /dev/null
++++ b/src/base/ftinf_sh.gperf
+@@ -0,0 +1,266 @@
++%struct-type
++%define slot-name name
++%enum
++%switch=1
++%readonly-tables
++%omit-struct-type
++%define lookup-function-name _settings_get
++%define hash-function-name _settings_hash
++%{
++#include <ctype.h>
++static const struct ftinf_s* _settings_get( const char*str, unsigned len);
++%}
++struct ftinf_s;
++%%
++{ .name="custom",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 8, 24, 48, 24, 8},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=75,
++ .stem_fitting_strength=50,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++{ .name="classic",
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .filter_params={on, 6, 25, 38, 25, 6},
++ .gamma_correction={0, 100},
++ .use_various_tweaks=true
++},
++{ .name="disabled",
++ .gamma_correction={0, 100},
++},
++{ .name="ipad",
++ .filter_params={on, 0, 0, 100, 0, 0},
++ .gamma_correction={1000, 80},
++ .grayscale_filter_strength=100
++},
++{ .name="infinality",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=25,
++ .stem_snapping_sliding_scale=40,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=5
++},
++{ .name="linux",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .gamma_correction={0, 100},
++ .use_various_tweaks=true
++},
++{ .name="nudge",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_various_tweaks=true,
++},
++{ .name="osx",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .bold_embolden_x_value=16,
++ .brightness=10,
++ .contrast=20,
++ .filter_params={on, 3, 32, 38, 32, 3},
++ .gamma_correction={1000, 80},
++ .global_embolden_y_value=8,
++ .grayscale_filter_strength=25,
++},
++{ .name="push",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=75,
++ .stem_fitting_strength=50,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++{ .name="sharpened",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=25,
++ .stem_fitting_strength=25,
++ .stem_snapping_sliding_scale=40,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++{ .name="shove",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_increase_glyph_heights=true,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=100,
++ .stem_fitting_strength=100,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true
++},
++{ .name="ubuntu",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=-10,
++ .contrast=15,
++ .filter_params={on, 11, 22, 38, 22, 11},
++ .gamma_correction={1000, 80},
++ .use_various_tweaks=true
++},
++{ .name="ultimate1",
++ .filter_params={on, 4, 22, 38, 22, 4},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++{ .name="ultimate2",
++ .filter_params={on, 6, 22, 36, 22, 6},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++{ .name="ultimate3",
++ .filter_params={on, 8, 24, 36, 24, 8},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++{ .name="ultimate4",
++ .filter_params={on, 10, 25, 37, 25, 10},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++{ .name="ultimate5",
++ .filter_params={on, 12, 28, 42, 28, 12},
++ .fringe_filter_strength=25,
++ .gamma_correction={0, 100},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=25
++},
++{ .name="vanilla",
++ .filter_params={on, 6, 25, 38, 25, 6},
++ .gamma_correction={0, 100},
++},
++{ .name="windows7light",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .contrast=20,
++ .filter_params={on, 20, 25, 38, 25, 05},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 160},
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=100
++},
++{ .name="windows7",
++ .filter_params={on, 20, 25, 42, 25, 06},
++ .fringe_filter_strength=100,
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_vertical_stem_darken_strength=25,
++ .windows_style_sharpening_strength=65,
++ .gamma_correction={1000, 120},
++ .brightness=10,
++ .contrast=20,
++ .use_various_tweaks=true,
++ .autohint_snap_stem_height=100,
++ .use_known_settings_on_selected_fonts=true,
++},
++{ .name="windowsxp",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=10,
++ .contrast=20,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 120},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++{ .name="windowsxplight",
++ .autohint_horizontal_stem_darken_strength=10,
++ .autohint_snap_stem_height=100,
++ .autohint_vertical_stem_darken_strength=25,
++ .brightness=20,
++ .contrast=30,
++ .filter_params={on, 6, 25, 44, 25, 6},
++ .fringe_filter_strength=100,
++ .gamma_correction={1000, 120},
++ .stem_alignment_strength=15,
++ .stem_fitting_strength=15,
++ .stem_snapping_sliding_scale=30,
++ .use_known_settings_on_selected_fonts=true,
++ .use_various_tweaks=true,
++ .windows_style_sharpening_strength=65
++},
++%%
++
++static const ftinf_t*
++ftinf_settings( const char *name ){
++ if( name ){
++ enum {
++ max_wlen=31
++ };
++ char buf[max_wlen+1];
++ int len=strlen( name );
++ if( len <= max_wlen ){
++ const ftinf_t *p;
++ int i;
++ for( i=0; i<len; ++i )
++ buf[i]=tolower( name[i] );
++ buf[len]='\0';
++ p=_settings_get( buf, len );
++ if( p ) return p;
++ }
++ }
++ return NULL;
++}
++/*
++ gperf --output-file=ftinf_sh.c ftinf_sh.gperf
++*/
+diff --git a/src/base/ftinit.c b/src/base/ftinit.c
+index b65a91d..54c06f9 100644
+--- a/src/base/ftinit.c
++++ b/src/base/ftinit.c
+@@ -43,7 +43,9 @@
+ #include FT_INTERNAL_DEBUG_H
+ #include FT_MODULE_H
+ #include "basepic.h"
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "ftinf.h"
++#endif
+
+ /*************************************************************************/
+ /* */
+@@ -253,9 +255,13 @@
+ error = FT_New_Library( memory, alibrary );
+ if ( error )
+ FT_Done_Memory( memory );
+- else
++ else {
+ FT_Add_Default_Modules( *alibrary );
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++ /* get Infinality settings */
++ ftinf_env();
++#endif
++ }
+ return error;
+ }
+
diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c
-index ff6f7e9..7b91443 100644
+index 5ee7e0a..9c9e9e4 100644
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
-@@ -23,6 +23,9 @@
+@@ -22,7 +22,10 @@
+ #include FT_LCD_FILTER_H
#include FT_IMAGE_H
#include FT_INTERNAL_OBJECTS_H
-
+-
+#include <math.h>
+#include <string.h>
+#include <strings.h>
++#include "ftinf.h"
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-@@ -309,10 +312,53 @@
- { 0x00, 0x55, 0x56, 0x55, 0x00 };
- /* the values here sum up to a value larger than 256, */
- /* providing a cheap gamma correction */
+@@ -305,11 +308,36 @@
+ FT_Library_SetLcdFilter( FT_Library library,
+ FT_LcdFilter filter )
+ {
- static const FT_Byte default_filter[5] =
-+ static FT_Byte default_filter[5] =
- { 0x10, 0x40, 0x70, 0x40, 0x10 };
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ int checked_filter_params_env = 0;
-
-+ if ( checked_filter_params_env == 0 )
+- { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
+ static const FT_Byte light_filter[5] =
+ { 0x00, 0x55, 0x56, 0x55, 0x00 };
+-
++#ifndef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++ static const FT_Byte default_filter[5] =
++ { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
++#else
++ FT_Byte default_filter[5];
++ if( ftinf && ftinf->filter_params[0] )
+ {
-+ char *filter_params = getenv( "INFINALITY_FT_FILTER_PARAMS" );
-+ if ( filter_params != NULL && strcmp( filter_params, "" ) != 0 )
-+ {
-+ float f1, f2, f3, f4, f5;
-
-+ if ( strcasecmp( filter_params, "default" ) != 0 )
-+ {
-+ int args_assigned = 0;
-+ args_assigned = sscanf ( filter_params,
-+ "%f %f %f %f %f",
-+ &f1, &f2, &f3, &f4, &f5 );
-+
-+ if ( args_assigned == 5 )
-+ {
-+ if ( f1 + f2 + f3 + f4 + f5 > 5 )
-+ {
-+ /* Assume we were given integers instead of floats */
-+ /* 0 to 100 */
-+ default_filter[0] = (FT_Byte) ( f1 * 2.55f + 0.5f );
-+ default_filter[1] = (FT_Byte) ( f2 * 2.55f + 0.5f );
-+ default_filter[2] = (FT_Byte) ( f3 * 2.55f + 0.5f );
-+ default_filter[3] = (FT_Byte) ( f4 * 2.55f + 0.5f );
-+ default_filter[4] = (FT_Byte) ( f5 * 2.55f + 0.5f );
-+ }
-+ else
-+ {
-+ /* Assume we were given floating point values */
-+ /* 0 to 1.0 */
-+ default_filter[0] = (FT_Byte) ( f1 * 255.0f + 0.5f );
-+ default_filter[1] = (FT_Byte) ( f2 * 255.0f + 0.5f );
-+ default_filter[2] = (FT_Byte) ( f3 * 255.0f + 0.5f );
-+ default_filter[3] = (FT_Byte) ( f4 * 255.0f + 0.5f );
-+ default_filter[4] = (FT_Byte) ( f5 * 255.0f + 0.5f );
-+ }
-+ }
-+ }
-+ }
-+ checked_filter_params_env = 1;
++ const int *f=ftinf->filter_params;
++ /* Assume we were given integers [0-100] get them to [0-255] */
++ int val; /* 2611=2.55*1024 */
++ val=(f[1]*2611+512)>>10; if( val > 255 ) val=255;
++ default_filter[0] = (FT_Byte) val;
++ val=(f[2]*2611+512)>>10; if( val > 255 ) val=255;
++ default_filter[1] = (FT_Byte) val;
++ val=(f[3]*2611+512)>>10; if( val > 255 ) val=255;
++ default_filter[2] = (FT_Byte) val;
++ val=(f[4]*2611+512)>>10; if( val > 255 ) val=255;
++ default_filter[3] = (FT_Byte) val;
++ val=(f[5]*2611+512)>>10; if( val > 255 ) val=255;
++ default_filter[4] = (FT_Byte) val;
++ } else {
++ default_filter[0]=0x08;
++ default_filter[1]=0x4d;
++ default_filter[2]=0x56;
++ default_filter[3]=0x4d;
++ default_filter[4]=0x08;
+ }
+#endif
+
if ( !library )
return FT_THROW( Invalid_Library_Handle );
-
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
-index 926ac0a..8a166a5 100644
+index ea40396..7156a0b 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
-@@ -67,6 +67,11 @@
+@@ -40,7 +40,9 @@
+ #ifdef FT_CONFIG_OPTION_MAC_FONTS
+ #include "ftbase.h"
+ #endif
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "ftinf.h"
++#endif
+
+ #ifdef FT_DEBUG_LEVEL_TRACE
+
+@@ -78,6 +80,11 @@
#define GRID_FIT_METRICS
@@ -518,7 +2626,7 @@ index 926ac0a..8a166a5 100644
FT_BASE_DEF( FT_Pointer )
ft_service_list_lookup( FT_ServiceDesc service_descriptors,
-@@ -543,6 +548,25 @@
+@@ -554,6 +561,25 @@
ft_lookup_glyph_renderer( FT_GlyphSlot slot );
@@ -544,36 +2652,14 @@ index 926ac0a..8a166a5 100644
#ifdef GRID_FIT_METRICS
static void
ft_glyphslot_grid_fit_metrics( FT_GlyphSlot slot,
-@@ -601,8 +625,40 @@
+@@ -612,8 +638,18 @@
FT_Bool autohint = FALSE;
FT_Module hinter;
TT_Face ttface = (TT_Face)face;
+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ int checked_use_various_tweaks_env = FALSE;
+ FT_Bool use_various_tweaks = FALSE;
-+
-+ if ( !checked_use_various_tweaks_env )
-+ {
-+ char *use_various_tweaks_env =
-+ getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
-+
-+ if ( use_various_tweaks_env != NULL )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "true") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "1") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "on") == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "yes") == 0 )
-+ use_various_tweaks = TRUE;
-+ }
-+ }
-+ checked_use_various_tweaks_env = 1;
-+ }
++ if( ftinf ) use_various_tweaks=ftinf->use_various_tweaks;
+ /* Force autohint if no tt instructions */
+ /* NOTE: NEEDS TO BE RUN LATER IN CODE???? */
@@ -585,7 +2671,7 @@ index 926ac0a..8a166a5 100644
if ( !face || !face->size || !face->glyph )
return FT_THROW( Invalid_Face_Handle );
-@@ -690,6 +746,18 @@
+@@ -702,6 +738,18 @@
{
FT_AutoHinter_Interface hinting;
@@ -604,7 +2690,7 @@ index 926ac0a..8a166a5 100644
/* try to load embedded bitmaps first if available */
/* */
-@@ -735,6 +803,18 @@
+@@ -747,6 +795,18 @@
if ( error )
goto Exit;
@@ -623,39 +2709,41 @@ index 926ac0a..8a166a5 100644
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
{
/* check that the loaded outline is correct */
+@@ -4724,6 +4784,11 @@
+ /* That's ok now */
+ *alibrary = library;
+
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++ /* get Infinality settings */
++ ftinf_env();
++#endif
++
+ return FT_Err_Ok;
+
+ #ifdef FT_CONFIG_OPTION_PIC
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
-index ef66b3c..c3e4c71 100644
+index 201ceab..4c8746d 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
-@@ -910,7 +910,34 @@
+@@ -29,7 +29,9 @@
+ #include FT_INTERNAL_CALC_H
+ #include FT_INTERNAL_DEBUG_H
+ #include FT_TRIGONOMETRY_H
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "ftinf.h"
++#endif
+
+ /*************************************************************************/
+ /* */
+@@ -910,7 +912,13 @@
FT_Vector* points;
FT_Int c, first, last;
FT_Int orientation;
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ int checked_use_various_tweaks_env = 0;
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ FT_Bool use_various_tweaks = FALSE;
++ if( ftinf ) use_various_tweaks=ftinf->use_various_tweaks;
-+ if ( checked_use_various_tweaks_env == 0 )
-+ {
-+ char *use_various_tweaks_env
-+ = getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
-+ if ( use_various_tweaks_env != NULL )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "true" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "1" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "on" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "yes" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ }
-+ }
-+ checked_use_various_tweaks_env = 1;
-+ }
-+
+ if ( use_various_tweaks )
+ ystrength = FT_PIX_FLOOR ( ystrength );
+#endif
@@ -663,43 +2751,33 @@ index ef66b3c..c3e4c71 100644
if ( !outline )
return FT_THROW( Invalid_Outline );
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
-index cd68533..62352e1 100644
+index cd68533..aa68c88 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
-@@ -93,7 +93,32 @@
+@@ -22,7 +22,9 @@
+ #include FT_INTERNAL_OBJECTS_H
+ #include FT_OUTLINE_H
+ #include FT_BITMAP_H
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
++#include "ftinf.h"
++#endif
+
+ /*************************************************************************/
+ /* */
+@@ -93,7 +95,10 @@
FT_Face face;
FT_Error error;
FT_Pos xstr, ystr;
-+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
-+ int checked_use_various_tweaks_env = 0;
+-
++#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ FT_Bool use_various_tweaks = FALSE;
-+
-+ if ( checked_use_various_tweaks_env == 0 )
-+ {
-+ char *use_various_tweaks_env
-+ = getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
-+ if ( use_various_tweaks_env != NULL )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp(use_various_tweaks_env, "true" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "1" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "on" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp(use_various_tweaks_env, "yes" ) == 0 )
-+ use_various_tweaks = TRUE;
-+ }
-
-+ }
-+ checked_use_various_tweaks_env = 1;
-+ }
++ if( ftinf ) use_various_tweaks=ftinf->use_various_tweaks;
+#endif
if ( !slot )
return;
-@@ -111,8 +136,16 @@
+@@ -111,8 +116,16 @@
ystr = xstr;
if ( slot->format == FT_GLYPH_FORMAT_OUTLINE )
@@ -717,7 +2795,7 @@ index cd68533..62352e1 100644
else /* slot->format == FT_GLYPH_FORMAT_BITMAP */
{
/* round to full pixels */
-@@ -150,6 +183,9 @@
+@@ -150,6 +163,9 @@
slot->metrics.width += xstr;
slot->metrics.height += ystr;
@@ -727,33 +2805,48 @@ index cd68533..62352e1 100644
slot->metrics.horiAdvance += xstr;
slot->metrics.vertAdvance += ystr;
slot->metrics.horiBearingY += ystr;
+diff --git a/src/base/rules.mk b/src/base/rules.mk
+index 1852e08..f7ae0e6 100644
+--- a/src/base/rules.mk
++++ b/src/base/rules.mk
+@@ -41,6 +41,7 @@ BASE_SRC := $(BASE_DIR)/basepic.c \
+ $(BASE_DIR)/ftcalc.c \
+ $(BASE_DIR)/ftdbgmem.c \
+ $(BASE_DIR)/ftgloadr.c \
++ $(BASE_DIR)/ftinf.c \
+ $(BASE_DIR)/ftobjs.c \
+ $(BASE_DIR)/ftoutln.c \
+ $(BASE_DIR)/ftpic.c \
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
-index 3620550..a92e003 100644
+index 3620550..b5b3056 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
-@@ -26,102 +26,3575 @@
+@@ -26,6 +26,18 @@
#include "ftsmerrs.h"
+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+#include <math.h>
+#include FT_BITMAP_H
++#include <string.h>
+#include <strings.h>
-+#include "../autofit/aflatin.h"
+#include FT_OUTLINE_H
++#include "../base/ftinf.h"
+
+#define verbose FALSE
+#define STVALUES if (verbose) \
+ printf ( "scale:%f translate:%ld ", *scale_value, *translate_value );
+#endif /* FT_CONFIG_OPTION_INFINALITY_PATCHSET */
-+
-+ /* initialize renderer -- init its raster */
-+ static FT_Error
-+ ft_smooth_init( FT_Renderer render )
-+ {
-+ FT_Library library = FT_MODULE_LIBRARY( render );
-+
-+
+
+ /* initialize renderer -- init its raster */
+ static FT_Error
+@@ -34,65 +46,2278 @@
+ FT_Library library = FT_MODULE_LIBRARY( render );
+
+
+- render->clazz->raster_class->raster_reset( render->raster,
+- library->raster_pool,
+- library->raster_pool_size );
+ render->clazz->raster_class->raster_reset( render->raster,
+ library->raster_pool,
+ library->raster_pool_size );
@@ -1287,15 +3380,13 @@ index 3620550..a92e003 100644
+ FT_Bitmap_Done( library, &new_bitmap );
+ }
+
-+
-+ int
++ static int
+ pseudo_gamma ( int val, float value )
+ {
-+ return 256 * ( 1.0 - pow( ( 1.0 - (float)val / 256.0 ), 1.0 / value ) );
++ return 256 * ( 1.0f - powf( ( 1.0f - val * (1.0f/256.0f) ), 1.0f / value ) );
+ }
+
-+
-+
++#if(0)
+ static void
+ _ft_bitmap_embolden ( FT_Bitmap* bitmap,
+ FT_UInt strength,
@@ -1364,7 +3455,7 @@ index 3620550..a92e003 100644
+ }
+ }
+ }
-+
++#endif
+
+ /* Fringe filter */
+ static void
@@ -1585,347 +3676,13 @@ index 3620550..a92e003 100644
+ }
+ }
+
-+
-+
-+ /*************************************************************************/
-+ /* */
-+ /* */
-+ /* */
-+ /* */
-+ /* */
-+ /* */
-+
-+
-+ typedef struct SA_Rule_
-+ {
-+ const char family[32];
-+ const int ppem[5];
-+
-+ } SA_Rule;
-+
++/*
++ These need to be in sync with params inside ftinf.c
++ (not ideal but perhaps better than making these public)
++ */
+#define STEM_WIDTH_2_PPEM 18
+#define MAX_PPEM 100
+
-+
-+
-+/* "Font name", {ppem where stem width becomes 1,
-+ * ppem where stem width becomes 2... etc.} */
-+/* 100 means auto-calculate */
-+#define SNAPPING_STEM_WIDTHS_RULES_SIZE 21
-+ SA_Rule SNAPPING_STEM_WIDTHS_Rules
-+ [SNAPPING_STEM_WIDTHS_RULES_SIZE] =
-+ {
-+ { "Andale Mono", {10, 21, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Arial Narrow", {10, 21, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Calibri", {10, 19, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Cantarell", {10, 22, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Century Gothic", {10, 22, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Comfortaa", {10, 19, 22, MAX_PPEM, MAX_PPEM} },
-+ { "Consolas", {10, 20, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Corbel", {10, 21, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Futura", {10, 14, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Gill Sans", {10, 17, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Helvetica CY", {10, 23, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Inconsolata", {10, 23, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Liberation Sans Narrow", {10, 22, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Liberation Sans", {10, 19, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Lucida Grande", {10, 16, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Lucida Sans Unicode", {10, 16, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Luxi Sans", {10, 17, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Open Sans", {10, 20, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Rokkitt", {10, 21, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Segoe UI", {10, 23, MAX_PPEM, MAX_PPEM, MAX_PPEM} },
-+ { "Trebuchet MS", {10, 17, STEM_WIDTH_2_PPEM, MAX_PPEM, MAX_PPEM} },
-+ };
-+
-+
-+/* "Font name", {ppem, scale_up=1|scale_down=0} */
-+#define SNAPPING_STEM_SCALING_RULES_SIZE 31
-+ SA_Rule SNAPPING_STEM_SCALING_Rules
-+ [SNAPPING_STEM_SCALING_RULES_SIZE] =
-+ {
-+ { "Andale Mono", {11, 1,} },
-+ { "Bitstream Vera Sans", {12, 1,} },
-+ { "Calibri", {15, 1,} },
-+ { "Calibri", {17, 1,} },
-+ { "Calibri", {18, 1,} },
-+ { "Candara", {14, 1,} },
-+ { "Candara", {17, 1,} },
-+ { "Canwell", {13, 0,} },
-+ { "Comfortaa", {11, 0,} },
-+ { "Consolas", {11, 1,} },
-+ { "DejaVu Sans", {12, 1,} },
-+ { "Freesans", {16, 0,} },
-+ { "Freeserif", {13, 1,} },
-+ { "Freeserif", {17, 1,} },
-+ { "Inconsolata", {12, 1,} },
-+ { "Inconsolata", {15, 1,} },
-+ { "Lucida Grande", {13, 1,} },
-+ { "Myriad Pro", {14, 1,} },
-+ { "Myriad Pro", {17, 1,} },
-+ { "Nina", {11, 0,} },
-+ { "Nina", {12, 0,} },
-+ { "Nina", {13, 0,} },
-+ { "Optima", {17, 1,} },
-+ { "Raleway", {15, 0,} },
-+ { "Samba", {11, 0,} },
-+ { "Times New Roman", {17, 1,} },
-+ { "Trebuchet MS", {17, 0,} },
-+ { "Trebuchet MS", {13, 0,} },
-+ { "Trebuchet MS", {20, 1,} },
-+ { "Verdana", {12, 1,} },
-+ { "Verdana", {15, 1,} },
-+ };
-+
-+
-+/* "Font name", {ppem, scale_up=1|scale_down=0} */
-+#define SNAPPING_M_RULES_SIZE 9
-+ SA_Rule SNAPPING_M_Rules
-+ [SNAPPING_M_RULES_SIZE] =
-+ {
-+ { "Courier New", {13, 1,} },
-+ { "Courier New", {14, 1,} },
-+ { "Courier", {13, 1,} },
-+ { "Courier", {14, 1,} },
-+ { "Droid Sans Mono", {12, 0,} },
-+ { "Bitstream Vera Sans", {12, 0,} },
-+ { "DejaVu Sans", {12, 0,} },
-+ { "Essential PragmataPro", {13, 0,} },
-+ { "Essential PragmataPro", {14, 0,} },
-+ };
-+
-+
-+/* "Font name", {ppem, ppem} */
-+#define SNAPPING_SYNTHESIZE_STEMS_RULES_SIZE 1
-+ SA_Rule SNAPPING_SYNTHESIZE_STEMS_Rules
-+ [SNAPPING_SYNTHESIZE_STEMS_RULES_SIZE] =
-+ {
-+ { "---", {13, 13,} },
-+ };
-+
-+
-+/* "Font name", {ppem, ppem} */
-+#define SNAPPING_NO_BEARING_CORRECTION_RULES_SIZE 1
-+ SA_Rule SNAPPING_NO_BEARING_CORRECTION_Rules
-+ [SNAPPING_NO_BEARING_CORRECTION_RULES_SIZE] =
-+ {
-+ { "Times New Roman", {0, 100,} },
-+ };
-+
-+
-+/* "Font name", {ppem, ppem} */
-+#define SNAPPING_EDGE_DETECTION_RULES_SIZE 8
-+ SA_Rule SNAPPING_EDGE_DETECTION_Rules
-+ [SNAPPING_EDGE_DETECTION_RULES_SIZE] =
-+ {
-+ { "Tahoma", {11, 11,} },
-+ { "Courier New", {10, 12,} },
-+ { "Arial", {11, 11,} },
-+ { "Arial", {13, 13,} },
-+ { "Liberation Sans", {11, 11,} },
-+ { "FreeSans", {11, 11,} },
-+ { "FreeSans", {13, 13,} },
-+ { "Palatino Linotype", {0, 100,} },
-+ };
-+
-+/* "Font name", {ppem, translate_value} */
-+#define SNAPPING_STEM_TRANSLATING_RULES_SIZE 6
-+ SA_Rule SNAPPING_STEM_TRANSLATING_Rules
-+ [SNAPPING_STEM_TRANSLATING_RULES_SIZE] =
-+ {
-+ { "Arial", {11, 32,} },
-+ { "Arial Unicode MS", {11, 32,} },
-+ { "FreeSans", {11, 32,} },
-+ { "Arimo", {11, 32,} },
-+ { "Liberation Sans", {11, 32,} },
-+ { "Tahoma", {11, 32,} },
-+ };
-+
-+/* "Font name", {ppem, translate_value} */
-+#define SNAPPING_STEM_TRANSLATING_ONLY_RULES_SIZE 74
-+ SA_Rule SNAPPING_STEM_TRANSLATING_ONLY_Rules
-+ [SNAPPING_STEM_TRANSLATING_ONLY_RULES_SIZE] =
-+ {
-+ { "Arial Unicode MS", {10, 16,} },
-+ { "Arial Unicode MS", {8, 32,} },
-+ { "Arial Unicode MS", {9, 32,} },
-+ { "Arial", {10, 16,} },
-+ { "Arial", {8, 32,} },
-+ { "Arial", {9, 32,} },
-+ { "Arial", {16, -24,} },
-+ { "Arimo", {10, 8,} },
-+ { "Arimo", {8, 32,} },
-+ { "Arimo", {9, 32,} },
-+ { "Bitstream Vera Sans", {8, 16,} },
-+ { "Calibri", {10, 16,} },
-+ { "Calibri", {15, 0,} },
-+ { "Candara", {10, 16,} },
-+ { "Cantarell", {11, 0} },
-+ { "Cantarell", {12, 0} },
-+ { "Consolas", {8, 32,} },
-+ { "Consolas", {9, 32,} },
-+ { "Corbel", {10, 16,} },
-+ { "Courier", {13, 16,} },
-+ { "Courier", {15, 0,} },
-+ { "Dejavu Sans Mono", {7, 16,} },
-+ { "Dejavu Sans Mono", {8, 32,} },
-+ { "Dejavu Sans Mono", {9, 16,} },
-+ { "Dejavu Sans", {8, 16,} },
-+ { "Dejavu Sans", {15, -20,} },
-+ { "Droid Sans", {8, 16,} },
-+ { "Droid Sans", {9, 16,} },
-+ { "Freesans", {10, 16,} },
-+ { "Freesans", {9, 8,} },
-+ { "Georgia", {13, 16,} },
-+ { "Georgia", {14, 16,} },
-+ { "Georgia", {15, 0,} },
-+ { "Inconsolata", {10, 24,} },
-+ { "Inconsolata", {9, 32,} },
-+ { "Liberation Sans", {10, 8,} },
-+ { "Liberation Sans", {8, 32,} },
-+ { "Liberation Sans", {9, 32,} },
-+ { "Lucida Grande", {13, 24,} },
-+ { "Lucida Grande", {14, 24,} },
-+ { "Lucida Grande", {8, 16,} },
-+ { "Lucida Grande", {9, 16,} },
-+ { "Lucida Sans Unicode", {13, 24,} },
-+ { "Lucida Sans Unicode", {14, 24,} },
-+ { "Lucida Sans Unicode", {8, 16,} },
-+ { "Lucida Sans Unicode", {9, 16,} },
-+ { "Microsoft Sans Serif", {10, 16,} },
-+ { "Microsoft Sans Serif", {8, 32,} },
-+ { "Microsoft Sans Serif", {9, 32,} },
-+ { "Myriad Pro", {10, 16,} },
-+ { "Myriad Pro", {11, 0,} },
-+ { "Myriad Pro", {9, 16,} },
-+ { "Open Sans", {10, 16,} },
-+ { "Open Sans", {9, 16,} },
-+ { "Optima", {10, 0} },
-+ { "Optima", {11, 0} },
-+ { "Optima", {12, 0} },
-+ { "Segoe UI", {10, 0,} },
-+ { "Segoe UI", {7, 32,} },
-+ { "Segoe UI", {8, 16,} },
-+ { "Segoe UI", {9, 24,} },
-+ { "Tahoma", {7, 32,} },
-+ { "Tahoma", {8, 32,} },
-+ { "Tahoma", {9, 32,} },
-+ { "Times New Roman", {17, 8,} },
-+ { "Trebuchet MS", {10, 16,} },
-+ { "Trebuchet MS", {11, 0,} },
-+ { "Trebuchet MS", {8, 32,} },
-+ { "Trebuchet MS", {9, 32,} },
-+ { "Verdana", {8, 16,} },
-+ { "Verdana", {15, 16,} },
-+ { "Verdana", {14, 32,} },
-+ { "Verdana", {18, 32,} },
-+ { "Verdana", {19, 24,} },
-+ };
-+
-+
-+/* "Font name", {start ppem, end ppem} */
-+#define ALWAYS_USE_100_RULES_SIZE 46
-+ SA_Rule ALWAYS_USE_100_Rules
-+ [ALWAYS_USE_100_RULES_SIZE] =
-+ {
-+ { "Andale Mono", {0, MAX_PPEM,} },
-+ { "Arial Unicode MS", {0, MAX_PPEM,} },
-+ { "Arial", {0, MAX_PPEM,} },
-+ { "Arimo", {0, MAX_PPEM,} },
-+ { "Bitstream Vera Sans Mono", {0, MAX_PPEM,} },
-+ { "Bitstream Vera Sans", {10, 14,} },
-+ { "Bitstream Vera Sans", {16, 17,} },
-+ { "Calibri", {23, MAX_PPEM,} },
-+ { "Consolas", {0, MAX_PPEM,} },
-+ { "Courier New", {12, 12,} },
-+ { "Courier", {0, MAX_PPEM,} },
-+ { "Cousine", {0, MAX_PPEM,} },
-+ { "DejaVu Sans Mono", {0, MAX_PPEM,} },
-+ { "DejaVu Sans", {10, 14,} },
-+ { "DejaVu Sans", {16, 17,} },
-+ { "Droid Sans", {12, 12,} },
-+ { "Droid Sans", {15, 15,} },
-+ { "FreeMono", {0, MAX_PPEM,} },
-+ { "FreeSans", {0, MAX_PPEM,} },
-+ { "Liberation Mono", {0, MAX_PPEM,} },
-+ { "Lucida Console", {0, MAX_PPEM,} },
-+ { "Luxi Sans", {13, 13,} },
-+ { "Microsoft Sans Serif", {0, MAX_PPEM,} },
-+ { "Monaco", {0, MAX_PPEM,} },
-+ { "Segoe UI", {11, 12,} },
-+ { "Segoe UI", {14, 14,} },
-+ { "Tahoma", {11, 11,} },
-+ { "Tahoma", {14, MAX_PPEM,} },
-+ { "Times New Roman", {14, 14,} },
-+ { "Times New Roman", {16, 16,} },
-+ { "Trebuchet MS", {13, 13,} },
-+ { "Ubuntu", {12, 13,} },
-+ { "Ubuntu", {15, 15,} },
-+ { "Verdana", {0, 14,} },
-+ { "Verdana", {16, MAX_PPEM,} },
-+ { "Pragmata", {0, MAX_PPEM,} },
-+ { "Essential PragmataPro", {0, MAX_PPEM,} },
-+ };
-+
-+
-+
-+
-+#define AUTOHINT_BRIGHTNESS_RULES_SIZE 3
-+ SA_Rule BRIGHTNESS_Rules
-+ [AUTOHINT_BRIGHTNESS_RULES_SIZE] =
-+ {
-+ { "Baskerville", {0, -20,} },
-+ { "Garamond", {0, -20,} },
-+ { "Optima", {0, -20,} },
-+ };
-+
-+#define AUTOHINT_CONTRAST_RULES_SIZE 3
-+ SA_Rule CONTRAST_Rules
-+ [AUTOHINT_CONTRAST_RULES_SIZE] =
-+ {
-+ { "Baskerville", {0, 25,} },
-+ { "Garamond", {0, 25,} },
-+ { "Optima", {0, 25,} },
-+ };
-+
-+#if 0
-+#define STEM_SPACING_RULES_SIZE 3
-+ SA_Rule STEM_SPACING_Rules
-+ [STEM_SPACING_RULES_SIZE] =
-+ {
-+ { "Tahoma", {10, 12, 18, 18, 30} },
-+ { "Arial", {10, 11, 23, 25, 30} },
-+ { "Freesans", {10, 12, 18, 18, 30} },
-+ };
-+
-+#define STEM_START_RULES_SIZE 3
-+ SA_Rule STEM_START_Rules
-+ [STEM_START_RULES_SIZE] =
-+ {
-+ { "Tahoma", {14, 17, 30, 100, 100} },
-+ { "Arial", {11, 18, 23, 30, 30} },
-+ { "Freesans", {10, 18, 18, 25, 30} },
-+ };
-+#endif
-+
-+ typedef struct Stem_Data_
-+ {
-+ FT_Int stem_width;
-+ FT_Int stem_spacing;
-+ FT_Int stem_start;
-+ FT_Int stem_scaling;
-+ FT_Int stem_translating_only;
-+ FT_Int stem_translating;
-+ FT_Int brightness;
-+ FT_Int contrast;
-+ FT_Bool use_100;
-+ FT_Bool synth_stems;
-+ FT_Bool edge_detection;
-+ FT_Bool bearing_correction;
-+ FT_Int m;
-+ } Stem_Data;
-+
-+
+ typedef struct Stem_Segment_
+ {
+ FT_Long x1;
@@ -1953,7 +3710,6 @@ index 3620550..a92e003 100644
+ FT_Bool generated;
+ } Stem;
+
-+
+ static void
+ swap_stem ( Stem* s1, Stem* s2 )
+ {
@@ -1980,338 +3736,6 @@ index 3620550..a92e003 100644
+ s2->generated = s.generated;
+ }
+
-+
-+ FT_LOCAL_DEF( void )
-+ sa_fill_known_stem_values (
-+ FT_String* family,
-+ int ppem,
-+ FT_String* style,
-+ FT_UInt num_stems,
-+ Stem_Data* known_stem_values )
-+ {
-+ FT_Int i, j;
-+ if (verbose) printf("%s ", family);
-+
-+ i = 0;
-+ while ( i < SNAPPING_STEM_WIDTHS_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_STEM_WIDTHS_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ j = 0;
-+ known_stem_values->stem_width = 1;
-+
-+ while (j < 4)
-+ {
-+ if ( SNAPPING_STEM_WIDTHS_Rules[i].ppem[j] == MAX_PPEM )
-+ {
-+ known_stem_values->stem_width = -1; /* use default */
-+ j = 5;
-+ i = SNAPPING_STEM_WIDTHS_RULES_SIZE;
-+ }
-+ else if ( ppem < SNAPPING_STEM_WIDTHS_Rules[i].ppem[j] )
-+ {
-+ known_stem_values->stem_width = j;
-+ j = 5;
-+ i = SNAPPING_STEM_WIDTHS_RULES_SIZE;
-+ }
-+ j++;
-+ }
-+ }
-+ i++;
-+ }
-+
-+ i = 0;
-+ while ( i < SNAPPING_STEM_SCALING_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_STEM_SCALING_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->stem_scaling = -1; /* default */
-+
-+ if ( ppem == SNAPPING_STEM_SCALING_Rules[i].ppem[0] )
-+ {
-+ known_stem_values->stem_scaling
-+ = SNAPPING_STEM_SCALING_Rules[i].ppem[1];
-+ i = SNAPPING_STEM_SCALING_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+ i = 0;
-+ while ( i < SNAPPING_M_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_M_Rules[i].family, family ) == 0 ) )
-+ {
-+ known_stem_values->m = -1; /* default */
-+
-+ if ( ppem == SNAPPING_M_Rules[i].ppem[0] )
-+ {
-+ known_stem_values->m = SNAPPING_M_Rules[i].ppem[1];
-+ i = SNAPPING_M_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+ i = 0;
-+ while ( i < SNAPPING_STEM_TRANSLATING_ONLY_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_STEM_TRANSLATING_ONLY_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->stem_translating_only = -1024; /* default */
-+
-+ if ( ppem == SNAPPING_STEM_TRANSLATING_ONLY_Rules[i].ppem[0] ||
-+ SNAPPING_STEM_TRANSLATING_ONLY_Rules[i].ppem[0] == 0 )
-+ {
-+ known_stem_values->stem_translating_only
-+ = SNAPPING_STEM_TRANSLATING_ONLY_Rules[i].ppem[1];
-+ i = SNAPPING_STEM_TRANSLATING_ONLY_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+ i = 0;
-+ while ( i < SNAPPING_STEM_TRANSLATING_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_STEM_TRANSLATING_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->stem_translating = 0; /* default */
-+
-+ if ( ppem == SNAPPING_STEM_TRANSLATING_Rules[i].ppem[0] ||
-+ SNAPPING_STEM_TRANSLATING_Rules[i].ppem[0] == 0 )
-+ {
-+ known_stem_values->stem_translating
-+ = SNAPPING_STEM_TRANSLATING_Rules[i].ppem[1];
-+ i = SNAPPING_STEM_TRANSLATING_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+ i = 0;
-+ while ( i < ALWAYS_USE_100_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( ALWAYS_USE_100_Rules[i].family, family ) == 0 ) )
-+ {
-+ known_stem_values->use_100 = FALSE; /* default */
-+
-+ if ( ppem >= ALWAYS_USE_100_Rules[i].ppem[0] &&
-+ ppem <= ALWAYS_USE_100_Rules[i].ppem[1] )
-+ {
-+ known_stem_values->use_100 = TRUE;
-+ i = ALWAYS_USE_100_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+ i = 0;
-+ while ( i < SNAPPING_SYNTHESIZE_STEMS_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_SYNTHESIZE_STEMS_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->synth_stems = FALSE; /* default */
-+
-+ if ( ppem >= SNAPPING_SYNTHESIZE_STEMS_Rules[i].ppem[0] &&
-+ ppem <= SNAPPING_SYNTHESIZE_STEMS_Rules[i].ppem[1] )
-+ {
-+ known_stem_values->synth_stems = TRUE;
-+ i = SNAPPING_SYNTHESIZE_STEMS_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+ i = 0;
-+ while ( i < SNAPPING_EDGE_DETECTION_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_EDGE_DETECTION_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->edge_detection = FALSE; /* default */
-+
-+ if ( ppem >= SNAPPING_EDGE_DETECTION_Rules[i].ppem[0] &&
-+ ppem <= SNAPPING_EDGE_DETECTION_Rules[i].ppem[1] )
-+ {
-+ known_stem_values->edge_detection = TRUE;
-+ i = SNAPPING_EDGE_DETECTION_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+ i = 0;
-+ while ( i < SNAPPING_NO_BEARING_CORRECTION_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( SNAPPING_NO_BEARING_CORRECTION_Rules[i].family,
-+ family ) == 0 ) )
-+ {
-+ known_stem_values->bearing_correction = TRUE; /* default */
-+
-+ if ( ppem >= SNAPPING_NO_BEARING_CORRECTION_Rules[i].ppem[0] &&
-+ ppem <= SNAPPING_NO_BEARING_CORRECTION_Rules[i].ppem[1] )
-+ {
-+ known_stem_values->bearing_correction = FALSE;
-+ i = SNAPPING_NO_BEARING_CORRECTION_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+
-+#if 0
-+ i = 0;
-+ while ( i < AUTOHINT_BRIGHTNESS_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( BRIGHTNESS_Rules[i].family, family ) == 0 ) )
-+ {
-+ known_stem_values->brightness = 0.0;
-+
-+ if ( ppem == BRIGHTNESS_Rules[i].ppem[0] ||
-+ BRIGHTNESS_Rules[i].ppem[0] == 0 )
-+ {
-+ known_stem_values->brightness = BRIGHTNESS_Rules[i].ppem[1];
-+ i = AUTOHINT_BRIGHTNESS_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+ i = 0;
-+ while ( i < AUTOHINT_CONTRAST_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( CONTRAST_Rules[i].family, family ) == 0 ) )
-+ {
-+ known_stem_values->contrast = 0.0;
-+
-+ if ( ppem == CONTRAST_Rules[i].ppem[0] ||
-+ CONTRAST_Rules[i].ppem[0] == 0 )
-+ {
-+ known_stem_values->contrast = CONTRAST_Rules[i].ppem[1];
-+ i = AUTOHINT_CONTRAST_RULES_SIZE;
-+ }
-+ }
-+ i++;
-+ }
-+
-+ for ( i = 0; i <= STEM_SPACING_RULES_SIZE; i++ )
-+ {
-+ if ( family &&
-+ ( strcasecmp( STEM_SPACING_Rules[i].family, family ) == 0 ) )
-+ {
-+ j = 0;
-+ known_stem_values->stem_spacing = 2; /* default */
-+
-+ while (j < 4)
-+ {
-+ if ( ppem < STEM_SPACING_Rules[i].ppem[j] )
-+ {
-+ known_stem_values->stem_spacing = j;
-+ j = 5;
-+ }
-+ j++;
-+ }
-+ }
-+ }
-+
-+
-+ for ( i = 0; i <= STEM_START_RULES_SIZE; i++ )
-+ {
-+ if ( family &&
-+ ( strcasecmp( STEM_START_Rules[i].family, family ) == 0 ) )
-+ {
-+ j = 0;
-+ known_stem_values->stem_start = 1; /* default */
-+
-+ while (j < 4)
-+ {
-+ if ( ppem < STEM_START_Rules[i].ppem[j] )
-+ {
-+ known_stem_values->stem_start = j;
-+ j = 5;
-+ }
-+ j++;
-+ }
-+ }
-+ }
-+#endif
-+ }
-+
-+
-+ FT_LOCAL_DEF( FT_Int )
-+ get_contrast ( FT_String* family,
-+ int ppem )
-+ {
-+ FT_Int i;
-+
-+
-+ if ( verbose )
-+ printf( "%s ", family );
-+
-+ i = 0;
-+ while ( i < AUTOHINT_CONTRAST_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( CONTRAST_Rules[i].family, family ) == 0 ) )
-+ {
-+ if ( ppem == CONTRAST_Rules[i].ppem[0] ||
-+ CONTRAST_Rules[i].ppem[0] == 0 )
-+ return CONTRAST_Rules[i].ppem[1];
-+ }
-+ i++;
-+ }
-+ return 0;
-+ }
-+
-+
-+ FT_LOCAL_DEF( FT_Int )
-+ get_brightness ( FT_String* family,
-+ int ppem )
-+ {
-+ FT_Int i;
-+
-+
-+ if ( verbose )
-+ printf("%s ", family);
-+
-+ i = 0;
-+ while ( i < AUTOHINT_BRIGHTNESS_RULES_SIZE )
-+ {
-+ if ( family &&
-+ ( strcasecmp( BRIGHTNESS_Rules[i].family, family ) == 0 ) )
-+ {
-+ if ( ppem == BRIGHTNESS_Rules[i].ppem[0] ||
-+ BRIGHTNESS_Rules[i].ppem[0] == 0 )
-+ return BRIGHTNESS_Rules[i].ppem[1];
-+ }
-+ i++;
-+ }
-+ return 0;
-+ }
-+
-+
+ /* Stem alignment for bitmaps; A hack with very nice results */
+ /* Ideally this could be implemented on the outline, prior to
+ * rasterization. Possible future enhancement is to use the
@@ -2347,7 +3771,7 @@ index 3620550..a92e003 100644
+ FT_Long rightmost_point_not_extrema = 0;
+ FT_Long num_segments = 0;
+ FT_Long num_centers = 0;
-+ FT_Long stem_centers[width * 256];
++ FT_Long *stem_centers;
+ FT_UInt h;
+ FT_ULong valid_stems = 0, valid_possible_stems = 0;
+ FT_Long center, stem_matches, stem_matches_ledge;
@@ -2383,55 +3807,16 @@ index 3620550..a92e003 100644
+ FT_Bool strategy_fit_to_width = FALSE;
+ /*FT_Bool strategy_center_glyph = FALSE;*/
+
-+ FT_Bool has_serifs = FALSE;
-+ FT_Bool autohinted = FALSE;
-+
+ const FT_Int MIN_PPEM = 7;
+ /*const FT_Int MAX_PPEM = 100;*/
+ const FT_Int MAX_STEMS = 3;
+ FT_Int ppem = 0;
+
-+ FT_Bool checked_use_known_settings_on_selected_fonts_env = FALSE;
-+ FT_Bool use_known_settings_on_selected_fonts = FALSE;
-+
-+ FT_Pos cur_width = infinality_cur_width;
-+
-+
-+ if ( cur_width )
-+ {
-+ autohinted = TRUE;
-+ }
++ Stem_Data stem_data;
+
+ /* reset to default */
+ *scale_value = 1.0;
+
-+ if ( !checked_use_known_settings_on_selected_fonts_env )
-+ {
-+ char *use_known_settings_on_selected_fonts_env =
-+ getenv( "INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS" );
-+ if ( use_known_settings_on_selected_fonts_env != NULL )
-+ {
-+ if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "default" ) != 0 )
-+ {
-+ if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "true") == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "1") == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "on") == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "yes") == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ }
-+ }
-+ checked_use_known_settings_on_selected_fonts_env = TRUE;
-+ }
-+
-+
+ /* Simply return in odd cases where these don't seem to be set */
+ /* Flash and some pdf viewers will crash otherwise */
+ if ( !slot->face ||
@@ -2450,6 +3835,10 @@ index 3620550..a92e003 100644
+
+ ppem = slot->face->size->metrics.x_ppem;
+
++ if ( ppem < 9 )
++ return;
++ if ( ppem > 20 )
++ strategy_use_m_control = TRUE;
+
+ /* only perform alignment on styles we know, that aren't bold or italic */
+ /* perhaps detection could be added on those that are not set? */
@@ -2506,14 +3895,6 @@ index 3620550..a92e003 100644
+ }
+ else return;
+
-+ if ( slot->face->family_name )
-+ {
-+ if ( strcasestr(slot->face->family_name, "Courier" ) ||
-+ strcasestr(slot->face->family_name, "Serif" ) ||
-+ strcasestr(slot->face->family_name, "Times" ) )
-+ has_serifs = TRUE;
-+ }
-+
+ if ( mode != FT_RENDER_MODE_LCD )
+ {
+ columns_per_pixel = 1;
@@ -2524,49 +3905,21 @@ index 3620550..a92e003 100644
+ /* There are issues with missing glyphs */
+ return;
+ }
-+ /* only look at top 3 for now */
-+ known_stem_values
-+ = (Stem_Data*) malloc ( columns_per_pixel * sizeof ( Stem_Data ) );
-+ known_stem_values->stem_spacing = -1;
-+ known_stem_values->stem_width = -1;
-+ known_stem_values->stem_start = -1;
-+ known_stem_values->stem_scaling = -1;
-+ known_stem_values->stem_translating_only = -1024;
-+ known_stem_values->stem_translating = 0;
-+ known_stem_values->brightness = 0;
-+ known_stem_values->contrast = 0;
-+ known_stem_values->use_100 = FALSE;
-+ known_stem_values->m = -1;
-+ known_stem_values->synth_stems = FALSE;
-+ known_stem_values->bearing_correction = TRUE;
-+
-+ if ( use_known_settings_on_selected_fonts )
-+ {
-+ sa_fill_known_stem_values ( slot->face->family_name,
-+ ppem, slot->face->style_name,
-+ valid_stems, known_stem_values );
-+ if ( verbose )
-+ printf ( "width:%d,spacing:%d,start:%d,scaling:%d,translate:%d ",
-+ known_stem_values->stem_width,
-+ known_stem_values->stem_spacing,
-+ known_stem_values->stem_start,
-+ known_stem_values->stem_scaling,
-+ known_stem_values->stem_translating_only );
-+ }
+
-+ /* translate value may be set for < 10 */
-+ if ( use_known_settings_on_selected_fonts &&
-+ known_stem_values->stem_translating_only > -1024 )
++ known_stem_values=&stem_data;
++ if ( ftinf && ftinf->use_known_settings_on_selected_fonts )
+ {
-+ *translate_value = known_stem_values->stem_translating_only;
-+ free ( known_stem_values );
-+ return;
-+ }
-+
-+ if ( use_known_settings_on_selected_fonts &&
-+ known_stem_values->bearing_correction == FALSE )
-+ strategy_bearing_correction = FALSE;
-+
++ ftinf_fill_stem_values( known_stem_values, slot->face->family_name, ppem, TRUE );
++ /* translate value may be set for < 10 */
++ if (known_stem_values->stem_translating_only > -1024 )
++ {
++ *translate_value = known_stem_values->stem_translating_only;
++ return;
++ }
++ if( known_stem_values->bearing_correction == FALSE )
++ strategy_bearing_correction = FALSE;
++ } else
++ ftinf_fill_stem_values( known_stem_values, slot->face->family_name, ppem, FALSE );
+
+ if ( known_stem_values->use_100 ||
+ known_stem_values->m >= 0 )
@@ -2578,42 +3931,24 @@ index 3620550..a92e003 100644
+ if ( known_stem_values->edge_detection )
+ strategy_also_use_edge_detection_for_stems = TRUE;
+
-+ if ( ppem < 9 )
-+ return;
-+ if ( ppem > 20 )
-+ strategy_use_m_control = TRUE;
-+
+ /* Allocate */
-+ segments
-+ = (Stem_Segment*) malloc( (1) * sizeof ( Stem_Segment ) );
-+ leftmost_segment
-+ = (Stem_Segment*) malloc( sizeof ( Stem_Segment ) );
-+ leftmost_segment_not_extrema
-+ = (Stem_Segment*) malloc( sizeof ( Stem_Segment ) );
-+ rightmost_segment
-+ = (Stem_Segment*) malloc( sizeof ( Stem_Segment ) );
-+ rightmost_segment_not_extrema
-+ = (Stem_Segment*) malloc( sizeof ( Stem_Segment ) );
-+
-+ stems = (Stem*) malloc ( MAX_STEMS * sizeof ( Stem ) );
-+ possible_stems = (Stem*) malloc ( MAX_STEMS * sizeof ( Stem ) );
-+ leftmost_stem = (Stem*) malloc ( sizeof (Stem));
-+ rightmost_stem = (Stem*) malloc ( sizeof(Stem));
-+ centers = (Stem_Center*) malloc ( (1) * sizeof ( Stem_Center ) );
++ segments = NULL;
++ leftmost_segment = (Stem_Segment*) malloc( 4*sizeof ( Stem_Segment ) );
++ leftmost_segment_not_extrema = leftmost_segment+1;
++ rightmost_segment = leftmost_segment+2;
++ rightmost_segment_not_extrema = leftmost_segment+3;
++
++ stems = (Stem*) malloc ( (2*MAX_STEMS+2) * sizeof ( Stem ) );
++ possible_stems = stems+MAX_STEMS;
++ leftmost_stem = possible_stems+MAX_STEMS;
++ rightmost_stem = leftmost_stem + 1;
++ centers = NULL;
+
+ if ( verbose )
+ printf("\n");
+
+ /* Initialize */
-+ for ( xx = 0; xx < width * 256; xx += 1 )
-+ stem_centers[xx] = 0;
-+
-+ for ( xx = 0; xx < num_segments; xx += 1 )
-+ {
-+ segments[xx].x1 = 0;
-+ segments[xx].x2 = 0;
-+ segments[xx].y = 0;
-+ }
++ stem_centers=(FT_Long*)calloc( width * 256, sizeof(stem_centers[0]) );
+
+ rightmost_segment->x1 = 0;
+ rightmost_segment->x2 = 0;
@@ -2636,9 +3971,10 @@ index 3620550..a92e003 100644
+ /* Calculate various sums and stem widths of glyph */
+ for ( xx = 0; xx < width; xx += 1 )
+ {
-+ /* Reallocate */
-+ segments = (Stem_Segment*) realloc
-+ ( segments, ( num_segments + 1 ) * sizeof ( Stem_Segment ) );
++ /* Reallocate (in blocks of 64) */
++ if( num_segments % 64 == 0 )
++ segments = (Stem_Segment*) realloc
++ ( segments, ( num_segments + 64 ) * sizeof ( Stem_Segment ) );
+
+ /* if line is white, and now has color, it's the start of a stem */
+ if ( current_value == 0 && line[xx] > 0 )
@@ -2663,9 +3999,10 @@ index 3620550..a92e003 100644
+ stem_center_x = ( segments[num_segments].x2
+ + segments[num_segments].x1 ) / 2;
+
-+ /* Reallocate */
-+ centers = (Stem_Center*) realloc
-+ ( centers, ( num_centers + 1 ) * sizeof ( Stem_Center ) );
++ /* Reallocate (in blocks of 32) */
++ if( num_centers % 32 == 0 )
++ centers = (Stem_Center*) realloc
++ ( centers, ( num_centers + 32 ) * sizeof ( Stem_Center ) );
+ centers[num_centers].x = stem_center_x;
+ centers[num_centers].y = h;
+ centers[num_centers].x1 = segments[num_segments].x1;
@@ -2772,13 +4109,13 @@ index 3620550..a92e003 100644
+ /* but 1 or 2 with 3 stems needs to somehow get included */
+ FT_Int deviation1 = 5;
+ FT_Int deviation2=-1, requirement1 = 4, stem_match_requirement = 3;
-+ FT_Int best_height = 0, center_difference_in_height;
++ FT_Int center_difference_in_height;
+ FT_Int center_difference_in_width, valid_center_average;
+ FT_Int smallest_width_ledge, smallest_width_redge;
+ FT_Int x1_difference_in_width, x2_difference_in_width;
-+ FT_Bool large_gap_found = FALSE, no_gap_found = FALSE;
-+ FT_Bool large_gap_found_ledge = FALSE, no_gap_found_ledge = FALSE;
-+ FT_Bool large_gap_found_redge = FALSE, no_gap_found_redge = FALSE;
++ FT_Bool no_gap_found = FALSE;
++ FT_Bool no_gap_found_ledge = FALSE;
++ FT_Bool no_gap_found_redge = FALSE;
+ FT_Bool stem_detected = FALSE;
+ FT_Int set_width_to, set_center_to;
+
@@ -2805,7 +4142,6 @@ index 3620550..a92e003 100644
+
+ valid_center_average = 0;
+
-+ large_gap_found = large_gap_found_ledge = large_gap_found_redge = FALSE;
+ no_gap_found = no_gap_found_ledge = no_gap_found_redge = FALSE;
+ stem_detected = FALSE;
+
@@ -2867,7 +4203,6 @@ index 3620550..a92e003 100644
+ if ( last_matching_center >= 0 &&
+ abs( centers[last_matching_center].y
+ - centers[next_center].y ) >= (FT_Int)bitmap->rows / 2 )
-+ large_gap_found = TRUE;
+
+ /* try to find where matching centers are next to each other */
+ if ( last_matching_center >= 0 &&
@@ -2901,7 +4236,6 @@ index 3620550..a92e003 100644
+ abs( centers[last_matching_ledge].y
+ - centers[next_center].y)
+ >= (FT_Int)bitmap->rows / 2 )
-+ large_gap_found_ledge = TRUE;
+
+ /* try to find where matching centers are next to each other */
+ if ( last_matching_ledge >= 0 &&
@@ -2935,7 +4269,6 @@ index 3620550..a92e003 100644
+ if ( last_matching_redge >= 0 &&
+ abs( centers[last_matching_redge].y
+ - centers[next_center].y ) >= (FT_Int)bitmap->rows / 2 )
-+ large_gap_found_redge = TRUE;
+
+ /* try to find where matching centers are next to each other */
+ if ( last_matching_redge >= 0 &&
@@ -2953,9 +4286,6 @@ index 3620550..a92e003 100644
+ if ( stem_matches > 0 )
+ valid_center_average /= stem_matches;
+
-+ best_height = stem_matches;
-+
-+
+ if ( ( stem_matches >= stem_match_requirement ||
+ ( ( (FT_Int)bitmap->rows <= 6 || ppem < 11 ) &&
+ stem_matches >= 2 &&
@@ -2977,7 +4307,6 @@ index 3620550..a92e003 100644
+ {
+ stem_detected = TRUE;
+ set_width_to = centers[center].x2 - centers[center].x1;
-+ best_height = stem_matches;
+ set_center_to = centers[center].x;
+ }
+
@@ -2996,7 +4325,6 @@ index 3620550..a92e003 100644
+ {
+ stem_detected = TRUE;
+ set_width_to = smallest_width_ledge;
-+ best_height = stem_matches_ledge;
+ set_center_to = centers[center].x1 + set_width_to / 2;
+ stem_matches = stem_matches_ledge;
+ }
@@ -3012,7 +4340,6 @@ index 3620550..a92e003 100644
+ {
+ stem_detected = TRUE;
+ set_width_to = smallest_width_redge;
-+ best_height = stem_matches_redge;
+ set_center_to = centers[center].x2 - set_width_to / 2;
+ stem_matches = stem_matches_redge;
+ }
@@ -3021,8 +4348,7 @@ index 3620550..a92e003 100644
+
+ /*store and/or replace highest occurrences with 3 or more centers */
+ /* because this matched, it will become the top dog regardless */
-+ if ( stem_detected )
-+ if ( stem_matches > possible_stems[0].height )
++ if ( stem_detected && (stem_matches > possible_stems[0].height) )
+ {
+ /* if this is the first stem just go ahead */
+ if ( valid_possible_stems == 0 )
@@ -3251,23 +4577,45 @@ index 3620550..a92e003 100644
+ /* sort stems in x direction */
+ if ( valid_stems > 1 && stems[0].center > stems[1].center )
+ swap_stem ( &stems[0], &stems[1] );
-+
+
+- return 0;
+- }
+ if ( valid_stems == 0 && known_stem_values->stem_translating != 0 )
+ {
+ *translate_value += known_stem_values->stem_translating;
-+
+
+ if ( strategy_use_strengths )
+ {
+ /* consider 1/2 pixel the max when strength is at 100%,
+ unless translate is already greater than that */
+ FT_Int strength_cutoff = 32;
-+
-+
+
+- /* sets render-specific mode */
+- static FT_Error
+- ft_smooth_set_mode( FT_Renderer render,
+- FT_ULong mode_tag,
+- FT_Pointer data )
+- {
+- /* we simply pass it to the raster */
+- return render->clazz->raster_class->raster_set_mode( render->raster,
+- mode_tag,
+- data );
+- }
+
+- /* transform a given glyph image */
+- static FT_Error
+- ft_smooth_transform( FT_Renderer render,
+- FT_GlyphSlot slot,
+- const FT_Matrix* matrix,
+- const FT_Vector* delta )
+- {
+- FT_Error error = FT_Err_Ok;
+ if ( abs ( *translate_value ) > strength_cutoff)
+ strength_cutoff = *translate_value;
-+
+
+ max_strength = ( strength_cutoff * alignment_strength ) / 100;
-+
+
+- if ( slot->format != render->glyph_format )
+ if ( *translate_value < -max_strength )
+ *translate_value = -max_strength;
+ else if ( *translate_value > max_strength )
@@ -3276,7 +4624,8 @@ index 3620550..a92e003 100644
+ }
+ else
+ /* Start snapping */
-+ {
+ {
+- error = FT_THROW( Invalid_Argument );
+ FT_Int center_offset;
+ FT_Int modulus;
+ FT_Int delta, delta2;
@@ -3407,7 +4756,7 @@ index 3620550..a92e003 100644
+ < stems[main_stem].width * 2 )
+ {
+ /* Possibly use 2 only when compatible widths is on? */
-+ FT_Int mod_factor = 2;
++ FT_Int mod_factor = 2;
+
+ if ( verbose )
+ printf ( "USING M CONTROL ");
@@ -3426,7 +4775,7 @@ index 3620550..a92e003 100644
+ new_distance = distance_ceiling;
+ /* NEED TO FIGURE OUT A WAY TO DETERMINE WHETHER
+ THAT NUDGE IS UP OR DOWN */
-+ else if ( stem_distance + one_pixel * 2.6 >= advance_width &&
++ else if ( stem_distance + one_pixel * 2.6 >= advance_width &&
+ stem_width < one_pixel * 1.25 )
+ new_distance = distance_ceiling;
+
@@ -3478,7 +4827,7 @@ index 3620550..a92e003 100644
+ < stems[main_stem].width * 2 )
+ {
+ /* Possibly use 2 only when compatible widths is on? */
-+ FT_Int mod_factor = 2;
++ FT_Int mod_factor = 2;
+
+ if ( verbose )
+ printf ("USING M CONTROL ");
@@ -3714,13 +5063,19 @@ index 3620550..a92e003 100644
+ printf ( "TRANSLATING -64 " );
+ }
+ }
-+ goto Exit;
-+ }
-+
+ goto Exit;
+ }
+
+- if ( matrix )
+- FT_Outline_Transform( &slot->outline, matrix );
+ Exit:
-+
+
+- if ( delta )
+- FT_Outline_Translate( &slot->outline, delta->x, delta->y );
+#define transformed_point( point ) point * *scale_value + *translate_value * 12
-+
+
+- Exit:
+- return error;
+ if ( strategy_correct_out_of_bounds_outlines )
+ {
+ /* Correct if outside bitmap */
@@ -3737,36 +5092,36 @@ index 3620550..a92e003 100644
+ }
+
+ STVALUES
-+
++ free ( centers );
+ free ( segments );
-+ free ( leftmost_segment );
-+ free ( leftmost_segment_not_extrema );
-+ free ( rightmost_segment );
-+ free ( rightmost_segment_not_extrema );
-+ free ( known_stem_values );
++ free ( stem_centers );
+ free ( stems );
-+ free ( possible_stems );
-+ free ( leftmost_stem );
-+ free ( rightmost_stem );
-+ free ( centers );
-+ }
-+
-+
++ free ( leftmost_segment );
+ }
+
+
+- /* return the glyph's control box */
+ /* Gamma correction */
-+ static void
+ static void
+- ft_smooth_get_cbox( FT_Renderer render,
+- FT_GlyphSlot slot,
+- FT_BBox* cbox )
+ _ft_lcd_gamma_correction_correction ( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_GlyphSlot slot,
+ float gamma_correction_lt,
+ float gamma_correction_value )
-+ {
+ {
+- FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
+ if ( gamma_correction_value != 1.0 )
+ {
+ FT_UInt width = (FT_UInt)bitmap->width;
+ FT_UInt height = (FT_UInt)bitmap->rows;
+ FT_Byte* line = bitmap->buffer;
+ float ppem = (float)slot->face->size->metrics.x_ppem;
-+
+
+- if ( slot->format == render->glyph_format )
+- FT_Outline_Get_CBox( &slot->outline, cbox );
+
+ if ( !slot->face || !slot->face->size ) return;
+
@@ -3797,36 +5152,42 @@ index 3620550..a92e003 100644
+ }
+ }
+ }
-+ }
-+
+ }
+
+#endif
-+
-+ /* convert a slot's glyph image into a bitmap */
-+ static FT_Error
-+ ft_smooth_render_generic( FT_Renderer render,
-+ FT_GlyphSlot slot,
-+ FT_Render_Mode mode,
-+ const FT_Vector* origin,
-+ FT_Render_Mode required_mode )
-+ {
-+ FT_Error error;
+
+ /* convert a slot's glyph image into a bitmap */
+ static FT_Error
+@@ -103,25 +2328,162 @@
+ FT_Render_Mode required_mode )
+ {
+ FT_Error error;
+- FT_Outline* outline = &slot->outline;
+- FT_Bitmap* bitmap = &slot->bitmap;
+- FT_Memory memory = render->root.memory;
+ FT_Outline* outline = NULL;
+ FT_Outline* outline_orig = NULL;
-+ FT_BBox cbox;
+ FT_BBox cbox;
+- FT_Pos x_shift = 0;
+- FT_Pos y_shift = 0;
+- FT_Pos x_left, y_top;
+- FT_Pos width, height, pitch;
+ FT_Pos width, height, pitch, ppem;
-+#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-+ FT_Pos height_org, width_org;
-+#endif
+ #ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ FT_Pos height_org, width_org;
+ #endif
+ FT_Bitmap* bitmap = &slot->bitmap;
+ FT_Memory memory = render->root.memory;
-+ FT_Int hmul = mode == FT_RENDER_MODE_LCD;
-+ FT_Int vmul = mode == FT_RENDER_MODE_LCD_V;
+ FT_Int hmul = mode == FT_RENDER_MODE_LCD;
+ FT_Int vmul = mode == FT_RENDER_MODE_LCD_V;
+ FT_Pos x_shift = 0;
+ FT_Pos y_shift = 0;
+ FT_Pos x_left, y_top;
-+
-+ FT_Raster_Params params;
-+
+
+ FT_Raster_Params params;
+
+- FT_Bool have_outline_shifted = FALSE;
+- FT_Bool have_buffer = FALSE;
+ FT_Bool have_translated_origin = FALSE;
+ FT_Bool have_outline_shifted = FALSE;
+ FT_Bool have_buffer = FALSE;
@@ -3839,68 +5200,41 @@ index 3620550..a92e003 100644
+
+
+ int chromeos_style_sharpening_strength = 0;
-+ int checked_chromeos_style_sharpening_strength = 0;
+ int alignment_strength = 0;
+ int fitting_strength = 0;
-+ FT_UInt checked_alignment_strength = 0;
-+ FT_UInt checked_fitting_strength = 0;
-+ FT_UInt checked_fringe_filter_strength = 0;
+ int fringe_filter_strength = 0;
-+ FT_UInt checked_grayscale_filter_strength = 0;
+ int grayscale_filter_strength = 0;
+
-+ FT_UInt checked_autohint_horizontal_stem_darken_strength = 0;
+ int autohint_horizontal_stem_darken_strength = 0;
-+
-+ FT_UInt checked_autohint_vertical_stem_darken_strength = 0;
+ int autohint_vertical_stem_darken_strength = 0;
+
+ int windows_style_sharpening_strength = 0;
-+ FT_UInt checked_windows_style_sharpening_strength = 0;
+ float gamma_correction_value = 1;
+ float gamma_correction_lt = 0;
-+ FT_UInt checked_gamma_correction_value = 0;
+
+ FT_Int brightness_value = 0.0;
-+ FT_UInt checked_brightness_value = 0;
-+
+ FT_Int contrast_value = 0.0;
-+ FT_UInt checked_contrast_value = 0;
+
+ FT_Int snapping_sliding_scale_value = 0;
-+ FT_UInt checked_snapping_sliding_scale_value = 0;
+
+ FT_Int global_embolden_x_value = 0;
-+ FT_UInt checked_global_embolden_x_value = 0;
-+
+ FT_Int global_embolden_y_value = 0;
-+ FT_UInt checked_global_embolden_y_value = 0;
+
+ FT_Int bold_embolden_x_value = 0;
-+ FT_UInt checked_bold_embolden_x_value = 0;
-+
+ FT_Int bold_embolden_y_value = 0;
-+ FT_UInt checked_bold_embolden_y_value = 0;
+
+ FT_Byte chromeos_cutoff;
+ double chromeos_gamma_value;
+
+ float embolden_value = 0.0;
+ FT_Bool autohinted = FALSE;
-+
-+ FT_UInt autohint_minimum_stem_height = 0;
-+ FT_UInt checked_autohint_minimum_stem_height = 0;
-+
-+ int checked_use_various_tweaks_env = 0;
+ FT_Bool use_various_tweaks = FALSE;
-+
-+ FT_Pos cur_width = infinality_cur_width;
++ FT_Pos cur_width = infinality_cur_width;
+
+ const FT_Int MIN_PPEM = 1;
+ /*const FT_Int MAX_PPEM = 100; */
+
-+ int checked_use_known_settings_on_selected_fonts_env = 0;
-+ FT_Bool use_known_settings_on_selected_fonts = FALSE;
++ FT_Bool use_known_settings_on_selected_fonts;
+
+ if ( slot->face &&
+ slot->face->size &&
@@ -3913,269 +5247,59 @@ index 3620550..a92e003 100644
+ {
+ autohinted = TRUE;
+ }
++ if( ftinf ){
++ const float *f=ftinf->gamma_correction;
+
-+ if ( checked_use_known_settings_on_selected_fonts_env == 0 )
-+ {
-+ char *use_known_settings_on_selected_fonts_env =
-+ getenv( "INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS" );
-+ if ( use_known_settings_on_selected_fonts_env != NULL )
-+ {
-+ if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "default" ) != 0 )
-+ {
-+ if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "true" ) == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "1" ) == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "on" ) == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ else if ( strcasecmp( use_known_settings_on_selected_fonts_env,
-+ "yes" ) == 0 )
-+ use_known_settings_on_selected_fonts = TRUE;
-+ }
-+ }
-+ checked_use_known_settings_on_selected_fonts_env = 1;
-+ }
-+
-+ if ( checked_use_various_tweaks_env == 0 )
-+ {
-+ char *use_various_tweaks_env
-+ = getenv( "INFINALITY_FT_USE_VARIOUS_TWEAKS" );
-+
-+ if ( use_various_tweaks_env != NULL )
-+ {
-+ if ( strcasecmp( use_various_tweaks_env, "default" ) != 0 )
-+ {
-+ if ( strcasecmp( use_various_tweaks_env, "true") == 0)
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp( use_various_tweaks_env, "1") == 0)
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp( use_various_tweaks_env, "on") == 0)
-+ use_various_tweaks = TRUE;
-+ else if ( strcasecmp( use_various_tweaks_env, "yes") == 0)
-+ use_various_tweaks = TRUE;
-+ }
-+ }
-+ checked_use_various_tweaks_env = 1;
-+ }
-+
-+ if ( checked_autohint_minimum_stem_height == 0 )
-+ {
-+ char *autohint_minimum_stem_height_env =
-+ getenv( "INFINALITY_FT_AUTOHINT_MINIMUM_STEM_WIDTH" );
-+
-+ if ( autohint_minimum_stem_height_env != NULL )
-+ {
-+ sscanf ( autohint_minimum_stem_height_env, "%u",
-+ &autohint_minimum_stem_height );
-+
-+ if ( autohint_minimum_stem_height > 100 )
-+ autohint_minimum_stem_height = 100;
-+ else if ( autohint_minimum_stem_height < 0 )
-+ autohint_minimum_stem_height = 0;
-+ }
-+ checked_autohint_minimum_stem_height = 1;
-+ }
-+
-+ if ( checked_snapping_sliding_scale_value == 0 )
-+ {
-+ char *snapping_sliding_scale_env =
-+ getenv ( "INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE" );
-+
-+ if ( snapping_sliding_scale_env != NULL )
-+ {
-+ sscanf ( snapping_sliding_scale_env, "%d",
-+ &snapping_sliding_scale_value );
-+
-+ if ( snapping_sliding_scale_value > MAX_PPEM )
-+ snapping_sliding_scale_value = 0;
-+ else if ( snapping_sliding_scale_value < 0 )
-+ snapping_sliding_scale_value = 0;
-+
-+ if (snapping_sliding_scale_value < 11 &&
-+ snapping_sliding_scale_value > 0 )
-+ snapping_sliding_scale_value = 11;
-+ }
-+ checked_snapping_sliding_scale_value = 1;
-+ }
-+
-+ if ( checked_alignment_strength == 0)
-+ {
-+ char *alignment_strength_env =
-+ getenv ( "INFINALITY_FT_STEM_ALIGNMENT_STRENGTH" );
++ use_known_settings_on_selected_fonts=ftinf->use_known_settings_on_selected_fonts;
++ use_various_tweaks=ftinf->use_various_tweaks;
++ snapping_sliding_scale_value=ftinf->stem_snapping_sliding_scale;
+
-+ if ( alignment_strength_env != NULL )
-+ {
-+ sscanf ( alignment_strength_env, "%d", &alignment_strength );
++ alignment_strength=ftinf->stem_alignment_strength;
++ if ( snapping_sliding_scale_value != 0 )
++ alignment_strength = sliding_scale(10, snapping_sliding_scale_value, alignment_strength, 100, ppem);
+
-+ if ( alignment_strength > 100 )
-+ alignment_strength = 100;
-+ else if ( alignment_strength < 0 )
-+ alignment_strength = 0;
-+ }
++ fitting_strength=ftinf->stem_fitting_strength;
++ if ( snapping_sliding_scale_value != 0 )
++ fitting_strength = sliding_scale(10, snapping_sliding_scale_value, fitting_strength, 100, ppem);
+
-+ if ( alignment_strength > 100 )
-+ alignment_strength = 100;
-+ checked_alignment_strength = 1;
++ chromeos_style_sharpening_strength=ftinf->chromeos_style_sharpening_strength;
+
-+ if ( snapping_sliding_scale_value != 0 )
-+ alignment_strength = sliding_scale
-+ ( 10, snapping_sliding_scale_value, alignment_strength, 100, ppem );
-+ }
++ if ( ppem > 10 )
++ chromeos_style_sharpening_strength =
++ ( chromeos_style_sharpening_strength * ppem ) / 10;
+
-+ if ( checked_fitting_strength == 0 )
-+ {
-+ char *fitting_strength_env =
-+ getenv( "INFINALITY_FT_STEM_FITTING_STRENGTH" );
-+
-+ if ( fitting_strength_env != NULL )
-+ {
-+ sscanf ( fitting_strength_env, "%d", &fitting_strength );
-+
-+ if ( fitting_strength > 100 )
-+ fitting_strength = 100;
-+ else if ( fitting_strength < 0 )
-+ fitting_strength = 0;
-+ }
-+
-+ if ( fitting_strength > 100 )
-+ fitting_strength = 100;
-+
-+ checked_fitting_strength = 1;
++ if ( chromeos_style_sharpening_strength > 100 )
++ chromeos_style_sharpening_strength = 100;
+
-+ if ( snapping_sliding_scale_value != 0 )
-+ fitting_strength = sliding_scale
-+ ( 10, snapping_sliding_scale_value, fitting_strength, 100, ppem );
-+ }
++ brightness_value=ftinf->brightness;
++ contrast_value=ftinf->contrast;
+
++ windows_style_sharpening_strength=ftinf->windows_style_sharpening_strength;
+
-+ if ( checked_chromeos_style_sharpening_strength == 0 )
-+ {
-+ char *chromeos_style_sharpening_strength_env =
-+ getenv( "INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH" );
-+ if ( chromeos_style_sharpening_strength_env != NULL )
-+ {
-+ sscanf ( chromeos_style_sharpening_strength_env, "%d",
-+ &chromeos_style_sharpening_strength );
++ /* Decrease effect slightly to have a more linear increase in sharpness */
++ windows_style_sharpening_strength =
++ ( ( windows_style_sharpening_strength
++ * windows_style_sharpening_strength ) / 100
++ + windows_style_sharpening_strength ) / 2;
+
-+ if ( chromeos_style_sharpening_strength > 100 )
-+ chromeos_style_sharpening_strength = 100;
-+ else if ( chromeos_style_sharpening_strength < 0 )
-+ chromeos_style_sharpening_strength = 0;
-+ }
++ gamma_correction_lt = f[0];
++ gamma_correction_value = f[1] / 100.0f;
+
-+ if ( ppem > 10 )
-+ chromeos_style_sharpening_strength =
-+ ( chromeos_style_sharpening_strength * ppem ) / 10;
++ fringe_filter_strength=ftinf->fringe_filter_strength;
++ grayscale_filter_strength=ftinf->grayscale_filter_strength;
+
-+ if ( chromeos_style_sharpening_strength > 100 )
-+ chromeos_style_sharpening_strength = 100;
-+ checked_chromeos_style_sharpening_strength = 1;
-+ }
++ autohint_horizontal_stem_darken_strength=ftinf->autohint_horizontal_stem_darken_strength;
++ autohint_vertical_stem_darken_strength=ftinf->autohint_vertical_stem_darken_strength;
+
++ global_embolden_x_value=ftinf->global_embolden_x_value;
++ global_embolden_y_value=ftinf->global_embolden_y_value;
+
-+ if ( checked_brightness_value == 0)
-+ {
-+ char *brightness_env = getenv( "INFINALITY_FT_BRIGHTNESS" );
-+ if ( brightness_env != NULL )
-+ {
-+ sscanf ( brightness_env, "%d", &brightness_value );
-+ if (brightness_value > 100 )
-+ brightness_value = 100;
-+ else if (brightness_value < -100 )
-+ brightness_value = 0;
-+ }
-+ checked_brightness_value = 1;
++ bold_embolden_x_value=ftinf->bold_embolden_x_value;
++ bold_embolden_y_value=ftinf->bold_embolden_y_value;
++ } else {
++ use_known_settings_on_selected_fonts=FALSE;
+ }
+
-+ if ( checked_contrast_value == 0)
-+ {
-+ char *contrast_env = getenv( "INFINALITY_FT_CONTRAST" );
-+ if ( contrast_env != NULL )
-+ {
-+ sscanf ( contrast_env, "%d", &contrast_value );
-+ if (contrast_value > 100 )
-+ contrast_value = 100;
-+ else if (contrast_value < -100 )
-+ contrast_value = 100;
-+ }
-+ checked_contrast_value = 1;
-+ }
-
-- /* initialize renderer -- init its raster */
-- static FT_Error
-- ft_smooth_init( FT_Renderer render )
-- {
-- FT_Library library = FT_MODULE_LIBRARY( render );
-+ if ( checked_windows_style_sharpening_strength == 0)
-+ {
-+ char *windows_style_sharpening_strength_env =
-+ getenv( "INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH" );
-
-+ if ( windows_style_sharpening_strength_env != NULL )
-+ {
-+ sscanf ( windows_style_sharpening_strength_env, "%d",
-+ &windows_style_sharpening_strength );
-
-- render->clazz->raster_class->raster_reset( render->raster,
-- library->raster_pool,
-- library->raster_pool_size );
-+ if ( windows_style_sharpening_strength > 100 )
-+ windows_style_sharpening_strength = 100;
-+ else if ( windows_style_sharpening_strength < 0 )
-+ windows_style_sharpening_strength = 0;
-+ }
-+ /* Decrease effect slightly to have a more linear increase in sharpness */
-+ windows_style_sharpening_strength =
-+ ( ( windows_style_sharpening_strength
-+ * windows_style_sharpening_strength ) / 100
-+ + windows_style_sharpening_strength ) / 2;
-+ checked_windows_style_sharpening_strength = 1;
-+ }
-
-- return 0;
-- }
-+ if ( checked_gamma_correction_value == 0 )
-+ {
-+ char *gamma_correction_value_env =
-+ getenv( "INFINALITY_FT_GAMMA_CORRECTION" );
-
-+ if ( gamma_correction_value_env != NULL )
-+ {
-+ float f1, f2;
-
-- /* sets render-specific mode */
-- static FT_Error
-- ft_smooth_set_mode( FT_Renderer render,
-- FT_ULong mode_tag,
-- FT_Pointer data )
-- {
-- /* we simply pass it to the raster */
-- return render->clazz->raster_class->raster_set_mode( render->raster,
-- mode_tag,
-- data );
-- }
-+ if ( strcasecmp( gamma_correction_value_env, "default" ) != 0 )
-+ {
-+ sscanf ( gamma_correction_value_env, "%f %f", &f1, &f2 );
-+ gamma_correction_lt = f1;
-+ gamma_correction_value = f2 / 100.0;
-+ }
-+ if ( gamma_correction_value < .01 ) gamma_correction_value = 1.0;
-+ }
-+ checked_gamma_correction_value = 1;
-+ }
-
-- /* transform a given glyph image */
-- static FT_Error
-- ft_smooth_transform( FT_Renderer render,
-- FT_GlyphSlot slot,
-- const FT_Matrix* matrix,
-- const FT_Vector* delta )
-- {
-- FT_Error error = FT_Err_Ok;
+ /* set gamma value to 1 if out of range */
+ if ( slot->face &&
+ slot->face->size &&
@@ -4186,182 +5310,7 @@ index 3620550..a92e003 100644
+ }
+ else
+ gamma_correction_value = 1;
-
-
-- if ( slot->format != render->glyph_format )
-+ if ( checked_fringe_filter_strength == 0 )
- {
-- error = FT_THROW( Invalid_Argument );
-- goto Exit;
-+ char *fringe_filter_strength_env =
-+ getenv( "INFINALITY_FT_FRINGE_FILTER_STRENGTH" );
-+ if ( fringe_filter_strength_env != NULL )
-+ {
-+ sscanf ( fringe_filter_strength_env, "%d", &fringe_filter_strength );
-+
-+ if ( fringe_filter_strength > 100 )
-+ fringe_filter_strength = 100;
-+ else if ( fringe_filter_strength < 0 )
-+ fringe_filter_strength = 0;
-+ }
-+ checked_fringe_filter_strength = 1;
- }
-
-- if ( matrix )
-- FT_Outline_Transform( &slot->outline, matrix );
-
-- if ( delta )
-- FT_Outline_Translate( &slot->outline, delta->x, delta->y );
-+ if ( checked_grayscale_filter_strength == 0)
-+ {
-+ char *grayscale_filter_strength_env =
-+ getenv( "INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH" );
-+ if ( grayscale_filter_strength_env != NULL )
-+ {
-+ sscanf ( grayscale_filter_strength_env, "%d",
-+ &grayscale_filter_strength );
-+ if ( grayscale_filter_strength > 100 ) grayscale_filter_strength = 100;
-+ else if (grayscale_filter_strength < 0 ) grayscale_filter_strength = 0;
-+ }
-+ checked_grayscale_filter_strength = 1;
-+ }
-
-- Exit:
-- return error;
-- }
-
-+ if ( checked_autohint_horizontal_stem_darken_strength == 0)
-+ {
-+ char *autohint_horizontal_stem_darken_strength_env =
-+ getenv( "INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH" );
-+ if ( autohint_horizontal_stem_darken_strength_env != NULL )
-+ {
-+ sscanf ( autohint_horizontal_stem_darken_strength_env, "%d",
-+ &autohint_horizontal_stem_darken_strength );
-
-- /* return the glyph's control box */
-- static void
-- ft_smooth_get_cbox( FT_Renderer render,
-- FT_GlyphSlot slot,
-- FT_BBox* cbox )
-- {
-- FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
-+ if ( autohint_horizontal_stem_darken_strength > 100 )
-+ autohint_horizontal_stem_darken_strength = 100;
-+ else if ( autohint_horizontal_stem_darken_strength < 0 )
-+ autohint_horizontal_stem_darken_strength = 0;
-+ }
-+ checked_autohint_horizontal_stem_darken_strength = 1;
-+ }
-
-- if ( slot->format == render->glyph_format )
-- FT_Outline_Get_CBox( &slot->outline, cbox );
-- }
-+ if ( checked_autohint_vertical_stem_darken_strength == 0)
-+ {
-+ char *autohint_vertical_stem_darken_strength_env =
-+ getenv( "INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH" );
-+ if ( autohint_vertical_stem_darken_strength_env != NULL )
-+ {
-+ sscanf ( autohint_vertical_stem_darken_strength_env, "%d",
-+ &autohint_vertical_stem_darken_strength );
-
-+ if ( autohint_vertical_stem_darken_strength > 100 )
-+ autohint_vertical_stem_darken_strength = 100;
-+ else if ( autohint_horizontal_stem_darken_strength < 0 )
-+ autohint_vertical_stem_darken_strength = 0;
-+ }
-+ checked_autohint_vertical_stem_darken_strength = 1;
-+ }
-
-- /* convert a slot's glyph image into a bitmap */
-- static FT_Error
-- ft_smooth_render_generic( FT_Renderer render,
-- FT_GlyphSlot slot,
-- FT_Render_Mode mode,
-- const FT_Vector* origin,
-- FT_Render_Mode required_mode )
-- {
-- FT_Error error;
-- FT_Outline* outline = &slot->outline;
-- FT_Bitmap* bitmap = &slot->bitmap;
-- FT_Memory memory = render->root.memory;
-- FT_BBox cbox;
-- FT_Pos x_shift = 0;
-- FT_Pos y_shift = 0;
-- FT_Pos x_left, y_top;
-- FT_Pos width, height, pitch;
--#ifndef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-- FT_Pos height_org, width_org;
--#endif
-- FT_Int hmul = mode == FT_RENDER_MODE_LCD;
-- FT_Int vmul = mode == FT_RENDER_MODE_LCD_V;
-+ if ( checked_global_embolden_x_value == 0)
-+ {
-+ char *global_embolden_x_env =
-+ getenv ( "INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE" );
-+ if ( global_embolden_x_env != NULL )
-+ {
-+ sscanf ( global_embolden_x_env, "%d", &global_embolden_x_value );
-
-- FT_Raster_Params params;
-+ if ( global_embolden_x_value > 128 )
-+ global_embolden_x_value = 128;
-+ else if ( global_embolden_x_value < -128 )
-+ global_embolden_x_value = -128;
-+ }
-+ checked_global_embolden_x_value = 1;
-+ }
-+
-+ if ( checked_global_embolden_y_value == 0)
-+ {
-+ char *global_embolden_y_env =
-+ getenv ( "INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE" );
-+ if ( global_embolden_y_env != NULL )
-+ {
-+ sscanf ( global_embolden_y_env, "%d", &global_embolden_y_value );
-+ if ( global_embolden_y_value > 128 )
-+ global_embolden_y_value = 128;
-+ else if ( global_embolden_y_value < -128 )
-+ global_embolden_y_value = -128;
-+ }
-+ checked_global_embolden_y_value = 1;
-+ }
-+
+
-+ if ( checked_bold_embolden_x_value == 0)
-+ {
-+ char *bold_embolden_x_env =
-+ getenv ( "INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE" );
-+
-+ if ( bold_embolden_x_env != NULL )
-+ {
-+ sscanf ( bold_embolden_x_env, "%d", &bold_embolden_x_value );
-+ if (bold_embolden_x_value > 128 )
-+ bold_embolden_x_value = 128;
-+ else if (bold_embolden_x_value < -128 )
-+ bold_embolden_x_value = -128;
-+ }
-+ checked_bold_embolden_x_value = 1;
-+ }
-+
-+ if ( checked_bold_embolden_y_value == 0)
-+ {
-+ char *bold_embolden_y_env = getenv ( "INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE" );
-+
-+ if ( bold_embolden_y_env != NULL )
-+ {
-+ sscanf ( bold_embolden_y_env, "%d", &bold_embolden_y_value );
-+ if (bold_embolden_y_value > 128 )
-+ bold_embolden_y_value = 128;
-+ else if (bold_embolden_y_value < -128 )
-+ bold_embolden_y_value = -128;
-+ }
-+ checked_bold_embolden_y_value = 1;
-+ }
-
-- FT_Bool have_outline_shifted = FALSE;
-- FT_Bool have_buffer = FALSE;
+ if( use_various_tweaks &&
+ slot->face &&
+ slot->face->style_name )
@@ -4374,14 +5323,14 @@ index 3620550..a92e003 100644
+ chromeos_style_sharpening_strength = 0;
+ }
+ }
-
++
+ /*if (fitting_strength == 100) scale_value = 1.1;*/
+
+#endif
/* check glyph image format */
if ( slot->format != render->glyph_format )
-@@ -137,26 +3610,119 @@
+@@ -137,26 +2499,119 @@
goto Exit;
}
@@ -4514,7 +5463,7 @@ index 3620550..a92e003 100644
width = (FT_ULong)( cbox.xMax - cbox.xMin ) >> 6;
height = (FT_ULong)( cbox.yMax - cbox.yMin ) >> 6;
-@@ -166,16 +3732,29 @@
+@@ -166,16 +2621,29 @@
height_org = height;
#endif
@@ -4546,7 +5495,7 @@ index 3620550..a92e003 100644
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
if ( slot->library->lcd_filter_func )
-@@ -185,33 +3764,25 @@
+@@ -185,33 +2653,25 @@
if ( hmul )
{
@@ -4587,59 +5536,62 @@ index 3620550..a92e003 100644
/* Required check is (pitch * height < FT_ULONG_MAX), */
/* but we care realistic cases only. Always pitch <= width. */
if ( width > 0x7FFF || height > 0x7FFF )
-@@ -222,25 +3793,6 @@
+@@ -222,6 +2682,22 @@
goto Exit;
}
-- /* release old bitmap buffer */
-- if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
-- {
-- FT_FREE( bitmap->buffer );
-- slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
-- }
--
-- /* allocate new one */
-- if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
-- goto Exit;
-- else
-- have_buffer = TRUE;
--
-- slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
--
-- slot->format = FT_GLYPH_FORMAT_BITMAP;
-- slot->bitmap_left = (FT_Int)x_left;
-- slot->bitmap_top = (FT_Int)y_top;
--
- bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
- bitmap->num_grays = 256;
- bitmap->width = (unsigned int)width;
-@@ -248,11 +3800,22 @@
- bitmap->pitch = pitch;
-
- /* translate outline to render it into the bitmap */
-- if ( x_shift || y_shift )
++ bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
++ bitmap->num_grays = 256;
++ bitmap->width = (unsigned int)width;
++ bitmap->rows = (unsigned int)height;
++ bitmap->pitch = pitch;
++
++ /* translate outline to render it into the bitmap */
+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
+ if ( align_called == 0 )
- {
-- FT_Outline_Translate( outline, x_shift, y_shift );
-- have_outline_shifted = TRUE;
++ {
+#endif
+ FT_Outline_Translate( outline, -x_shift, -y_shift );
+ have_outline_shifted = TRUE;
+#ifdef FT_CONFIG_OPTION_INFINALITY_PATCHSET
- }
++ }
+#endif
-+
-+ if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
-+ goto Exit;
-+ else
-+ have_buffer = TRUE;
-+
-+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+ /* release old bitmap buffer */
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+ {
+@@ -229,7 +2705,6 @@
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+ }
+- /* allocate new one */
+ if ( FT_ALLOC( bitmap->buffer, (FT_ULong)( pitch * height ) ) )
+ goto Exit;
+ else
+@@ -237,23 +2712,6 @@
+
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
+
+- slot->format = FT_GLYPH_FORMAT_BITMAP;
+- slot->bitmap_left = (FT_Int)x_left;
+- slot->bitmap_top = (FT_Int)y_top;
+-
+- bitmap->pixel_mode = FT_PIXEL_MODE_GRAY;
+- bitmap->num_grays = 256;
+- bitmap->width = (unsigned int)width;
+- bitmap->rows = (unsigned int)height;
+- bitmap->pitch = pitch;
+-
+- /* translate outline to render it into the bitmap */
+- if ( x_shift || y_shift )
+- {
+- FT_Outline_Translate( outline, x_shift, y_shift );
+- have_outline_shifted = TRUE;
+- }
+-
/* set up parameters */
params.target = bitmap;
-@@ -299,9 +3862,153 @@
+ params.source = outline;
+@@ -299,9 +2757,153 @@
if ( error )
goto Exit;
@@ -4722,9 +5674,9 @@ index 3620550..a92e003 100644
+ if ( autohinted )
+ {
+ /* if forcibly set use that, otherwise make a good estimate */
-+ if ( slot->face && !_ft_bitmap_bc ( bitmap,
-+ (float)get_brightness( slot->face->family_name, ppem ) / 300.0,
-+ (float)get_contrast( slot->face->family_name, ppem ) / 300.0 ) )
++ float contrast, brightness;
++ ftinf_get_bc( slot->face->family_name, ppem, &brightness, &contrast);
++ if ( slot->face && !_ft_bitmap_bc ( bitmap, brightness, contrast ) )
+ {
+ FT_Bool is_fixed_name = FALSE;
+
@@ -4741,7 +5693,7 @@ index 3620550..a92e003 100644
+ /* Adjust brightness / contrast automatically based on stem width */
+ if ( cur_width != 0 && cur_width < 30 )
+ cur_width = 30;
-+
++
+ if ( cur_width >= 30 && cur_width <= 60 )
+ {
+ float ppem_factor = sliding_scale ( 5, 11, 0.0, 1.0, ppem );
@@ -4793,7 +5745,7 @@ index 3620550..a92e003 100644
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
/* render outline into bitmap */
-@@ -359,6 +4066,20 @@
+@@ -359,6 +2961,20 @@
#endif /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@@ -4814,7 +5766,7 @@ index 3620550..a92e003 100644
/* everything is fine; don't deallocate buffer */
have_buffer = FALSE;
-@@ -366,7 +4087,9 @@
+@@ -366,7 +2982,9 @@
Exit:
if ( have_outline_shifted )
@@ -4826,10 +5778,10 @@ index 3620550..a92e003 100644
{
FT_FREE( bitmap->buffer );
diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c
-index d00a0f8..da05b5a 100644
+index 1c1d7de..bd37b44 100644
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
-@@ -5801,6 +5801,7 @@
+@@ -5792,6 +5792,7 @@
if ( exc->ignore_x_mode &&
exc->GS.freeVector.x != 0 &&
@@ -4837,3 +5789,93 @@ index d00a0f8..da05b5a 100644
!( exc->sph_tweak_flags & SPH_TWEAK_NORMAL_ROUND ) )
control_value_cutin = 0;
}
+diff --git a/src/base/ftinf_rh.c b/src/base/ftinf_rh.c
+index 4cd6f1a..606b567 100644
+--- a/src/base/ftinf_rh.c
++++ b/src/base/ftinf_rh.c
+@@ -1,5 +1,5 @@
+ /* ANSI-C code produced by gperf version 3.1 */
+-/* Command-line: gperf ftinf_rh.gperf */
++/* Command-line: gperf --output-file=ftinf_rh.c ftinf_rh.gperf */
+ /* Computed positions: -k'1,$' */
+
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+@@ -612,13 +612,11 @@ ftinf_rules( const char *name ){
+ char buf[max_wlen+1];
+ int len=strlen( name );
+ if( len <= max_wlen ){
+- const sa_rules_t *p;
+ int i;
+ for( i=0; i<len; ++i )
+ buf[i]=tolower( name[i] );
+ buf[len]='\0';
+- p=_rules_get( buf, len );
+- if( p ) return p;
++ return _rules_get( buf, len );
+ }
+ }
+ return NULL;
+diff --git a/src/base/ftinf_rh.gperf b/src/base/ftinf_rh.gperf
+index e25f9b6..9fd8aab 100644
+--- a/src/base/ftinf_rh.gperf
++++ b/src/base/ftinf_rh.gperf
+@@ -269,13 +269,11 @@ ftinf_rules( const char *name ){
+ char buf[max_wlen+1];
+ int len=strlen( name );
+ if( len <= max_wlen ){
+- const sa_rules_t *p;
+ int i;
+ for( i=0; i<len; ++i )
+ buf[i]=tolower( name[i] );
+ buf[len]='\0';
+- p=_rules_get( buf, len );
+- if( p ) return p;
++ return _rules_get( buf, len );
+ }
+ }
+ return NULL;
+diff --git a/src/base/ftinf_sh.c b/src/base/ftinf_sh.c
+index 7fc2222..87d2ff8 100644
+--- a/src/base/ftinf_sh.c
++++ b/src/base/ftinf_sh.c
+@@ -1,5 +1,5 @@
+ /* ANSI-C code produced by gperf version 3.1 */
+-/* Command-line: gperf ftinf_sh.gperf */
++/* Command-line: gperf --output-file=ftinf_sh.c ftinf_sh.gperf */
+ /* Computed positions: -k'1,$' */
+
+ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+@@ -449,13 +449,11 @@ ftinf_settings( const char *name ){
+ char buf[max_wlen+1];
+ int len=strlen( name );
+ if( len <= max_wlen ){
+- const ftinf_t *p;
+ int i;
+ for( i=0; i<len; ++i )
+ buf[i]=tolower( name[i] );
+ buf[len]='\0';
+- p=_settings_get( buf, len );
+- if( p ) return p;
++ return _settings_get( buf, len );
+ }
+ }
+ return NULL;
+diff --git a/src/base/ftinf_sh.gperf b/src/base/ftinf_sh.gperf
+index ba5fc0a..5f6e0ae 100644
+--- a/src/base/ftinf_sh.gperf
++++ b/src/base/ftinf_sh.gperf
+@@ -250,13 +250,11 @@ ftinf_settings( const char *name ){
+ char buf[max_wlen+1];
+ int len=strlen( name );
+ if( len <= max_wlen ){
+- const ftinf_t *p;
+ int i;
+ for( i=0; i<len; ++i )
+ buf[i]=tolower( name[i] );
+ buf[len]='\0';
+- p=_settings_get( buf, len );
+- if( p ) return p;
++ return _settings_get( buf, len );
+ }
+ }
+ return NULL;
diff --git a/CHANGELOG b/CHANGELOG
new file mode 100644
index 00000000000..198f1f14a20
--- /dev/null
+++ b/CHANGELOG
@@ -0,0 +1,316 @@
+
+freetype2-infinality-ultimate
+=============================
+
+CHANGELOG
+---------
+
+
+2015-12-05
+~~~~~~~~~~
+
+* `freetype2` code was updated with recent upstream commit up to rev.2015.12.05.
+* Fixed bug #124 ("WebKit browsers (Chromium, Opera) won't use freetype2 run-time settings with the new Infinality patch").
+* Infinality patch set cleanup and update.
+
+2015-11-30
+~~~~~~~~~~
+
+* `freetype2` code was updated with recent upstream commit.
+* Fixed reported issues with the new Infinality functionality.
+
+2015-11-28
+~~~~~~~~~~
+
+* Upstream `freetype2` version upgrade 2.6.2.
+* Infinality patch set was rewritten and optimized for speed (by mviikki16).
+ Default rendering style is hard coded now and set to `ultimate3`.
+* New `xft-settings.sh` was split from the original `infinality-settings.sh` script.
+* New `infinality-settings.sh` is now optional and offers more rendering styles and
+ new methods of customization.
+
+2015-11-10
+~~~~~~~~~~
+
+* Reverting buggy upstream changes to working condition.
+* The code base was merged with the upstream changes up to 2015.11.10.
+
+2015-11-08
+~~~~~~~~~~
+
+* The code base was merged with the upstream changes up to 2015.11.08.
+
+2015-10-05
+~~~~~~~~~~
+
+* Upstream version upgrade, rev. 2.6.1-1.
+
+2015-10-04
+~~~~~~~~~~
+
+* The code base was merged with the upstream changes up to 2015.10.04.
+
+2015-09-30
+~~~~~~~~~~
+
+* The code base was merged with the upstream changes up to 2015.09.29.
+
+2015-09-17
+~~~~~~~~~~
+
+* The code base was merged with the upstream changes up to 2015.09.15.
+
+2015-08-24
+~~~~~~~~~~
+
+* The code base was merged with the upstream changes up to 2015.08.24.
+* Build with _GNU_SOURCE for strcasestr and strcasecmp (goddesse).
+* Use freetype2's new header file macros where possible (goddesse).
+
+2015-07-28
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.6-2
+
+* The code base was merged with the upstream changes up to 2015.07.28.
+* Minor changes in the Infinality patchset (modified location of freetype2 header files
+ introduced by the upstream).
+
+
+2015-06-08
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.6-1
+
+* Upstream version upgrade.
+
+
+2015-05-31
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-7
+
+* The code base was merged with the upstream changes up to 2015.05.31.
+
+
+2015-05-12
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-6
+
+* The code base was merged with the upstream changes up to 2015.05.12.
+
+
+2015-04-26
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-5
+
+* The code base was merged with the upstream changes up to 2015.04.24.
+* Fixed #85 (`infinality-settings` renamed to `infinality-settings.sh`).
+
+
+2015-03-30
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-4
+
+* The code base was merged with the upstream changes up to 2015.03.30.
+
+
+2015-03-05
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-3
+
+* The code base was merged with the upstream changes up to 2015.03.01.
+* The Infinality patchset was revised and updated accordingly (compatibility
+ fixes by goddesse).
+
+
+2014-12-31
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-2
+
+* The code base was merged with the upstream changes up to 2015.01.23.
+* The Infinality patchset was revised and updated accordingly.
+* `infinality-settings` was update to rev. 0.4.8.3.
+
+
+2014-12-30
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.5-1 (inc. multilib)
+
+* Version upgrade release, 2.5.5.
+
+
+2014-12-23
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.4-2 (inc. multilib)
+
+* Merged with the recent upstream code base.
+* `infinality-settings`: slightly increased fringe filter strength.
+
+
+2014-12-07
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.4-1 (inc. multilib)
+
+* Version upgrade release, 2.5.4.
+* Merged with the recent upstream code base (fixing memory leaks on buggy fonts).
+
+
+2014-12-06
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-16 (inc. multilib)
+
+* Merged with the recent upstream code base.
+* Infinality patchset was updated and revised.
+
+
+2014-11-23
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-15 (inc. multilib)
+
+* Merged with the recent upstream code base.
+* Several bug fixes, including issue #53 (rendering and stability issues during
+ playback of `*.mkv` video files with embedded TTF fonts).
+
+
+2014-10-29
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-14 (inc. multilib)
+
+* Merged with the recent upstream code base.
+* `infinality-settings` was moved to `/etc/X11/xinit/xinitrc.d` to ensure that
+ `xrdb` sets `Xft` variables when an X server is already running.
+
+
+2014-10-16
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-13 (inc. multilib)
+
+* Merged with the recent upstream code base.
+
+
+2014-09-14
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-12 (inc. multilib)
+
+* Bug #40 (affecting Urxvt): do not track cur_width through setenv (by goddesse,
+ contributed by estar).
+* Merged with the recent upstream code base.
+
+
+2014-09-09
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-11
+
+* Changes to Infinality patchset:
+ * Bug #36: Fix small memory in _lcd_stem_align (by goddesse).
+ * Bug #38: Fix another small memory leak (by goddesse).
+ * Bug #39: Set have_outline_shifted properly in ftsmooth.c (by goddesse).
+* `infinality-settings.sh` was updated to v.0.4.8.0.
+ * All styles were revised and updated, providing a smoother and more distinctive
+ transition between visual variants, from sharp and light to dark and bold.
+ * Core rendering settings were simplified and remain stable for all styles.
+* New upstream changes were merged with freetype2 code base.
+
+
+2014-08-15
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-10
+
+* Merging with most recent upstream commits.
+
+
+2014-07-29
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-9
+
+* Merging with most recent upstream commits.
+* `infinality-settings.sh` was updated to v. 0.4.7.5.
+
+
+2014-07-08
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-8
+
+* Merging with most recent upstream commits.
+* Updating Infinality patchset accordingly.
+
+
+2014-05-15
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.3-5
+
+* Semi-major upgrade, introducing most changes and fixes present in the
+ development branch of the upstream `freetype2`.
+
+
+2014-03-21
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate
+
+* `infinality-settings.sh`: revised and updated rendering styles.
+* Updated dependencies.
+
+
+2013-12-09
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.1-2
+
+* Upstream version upgrade to 2.5.1
+* Revised and updated Infinality patchset.
+
+
+2013-10-11
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.0.1-7
+
+* Added `libpng` dependency.
+
+
+2013-07-24
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.0.1-6
+
+Minor changes to `infinality-settings.sh` meant to prevent inaccurate kerning issues.
+
+
+2013-07-11
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.0.1-5
+
+* `infinality-settings.sh`: taking measures against blurriness.
+
+
+2013-06-21
+~~~~~~~~~~
+
+### freetype2-infinality-ultimate, rev. 2.5.0.1-2
+
+* Upstream update 2.5.0.1.
+* Moving to Adobe CFF as the default renderer.
+* Improved and simplified infinality settings: most minor rendering issues was resolved.
+* Added new style, Classical.
+
diff --git a/PKGBUILD b/PKGBUILD
index f0c3c76913c..d11549cba4e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,50 +1,81 @@
-# Maintainer: hadrons123 <piruthviraj@gmail.com>
-# Maintainer: Shanto <shanto@hotmail.com>
-# Maintainer: Maarten de Boer <maarten@ikfixjewebstek.nl>
-# Contributor: JIN Xiao-Yong <jinxiaoyong@gmail.com>
-# Contributor: Andre Fettouhi <A.Fettouhi@gmail.com>
-
-pkgname=freetype2-infinality
-pkgver=2.6
-pkgrel=2
-pkgdesc="TrueType font rendering library with infinality patch"
-arch=(i686 x86_64)
-license=('GPL')
-url="https://github.com/bohoomil/fontconfig-ultimate"
-depends=('zlib' 'bzip2' 'sh')
-optdepends=(
- 'fontconfig-infinality: Infinality package for fontconfig (required)'
-)
-conflicts=('freetype2')
-provides=("freetype2=$pkgver")
-options=('!libtool')
-install='install.sh'
-backup=('etc/profile.d/infinality-settings.sh')
-source=(
- "http://downloads.sourceforge.net/sourceforge/freetype/freetype-${pkgver}.tar.bz2"
- "infinality-settings.sh"
- "01-freetype-2.6-enable-valid.patch"
- "02-upstream-2015.08.24.patch.xz"
- "03-infinality-2.6-2015.08.24.patch")
-sha256sums=('8469fb8124764f85029cc8247c31e132a2c5e51084ddce2a44ea32ee4ae8347e'
- '21192ce47be46ccd44e8aeea99754d4e5e38cb52717f752d67c319c74fea2716'
- '086c9874ba5217dab419ac03dbc5ad6480aaa67b3c9d802f7181d8a3e007f8eb'
- '62eaa124f09916e237be994890178fb041b3648223f08429566df3a962971d8a'
- '241de84ca25d7ff106a3ebd5121d12a315abe5a72771957bd674e8b2e41c97d2')
+# Maintainer: Jan de Groot <jgc@archlinux.org>
+# Maintainer: JIN Xiao-Yong <jinxiaoyong@gmail.com>
+# Maintainer: bohoomil <@zoho.com>
+
+pkgname=freetype2-infinality-ultimate
+pkgver=2.6.2
+pkgrel=1
+_patchrel=2015.12.05
+pkgdesc="TrueType font rendering library with Infinality patches and custom settings."
+arch=('armv7h' 'i686' 'x86_64')
+changelog=CHANGELOG
+license=('GPL' 'MIT')
+groups=('infinality-bundle')
+url="http://freetype.sourceforge.net"
+depends=('zlib' 'bzip2' 'sh' 'xorg-xrdb' 'libpng' 'harfbuzz')
+conflicts=('freetype2' 'freetype2-infinality')
+provides=("freetype2=$pkgver" 'freetype2-infinality' 'freetype2-infinality-ultimate')
+install='infinality.install'
+source=(http://downloads.sourceforge.net/sourceforge/freetype/freetype-${pkgver}.tar.bz2
+ "01-freetype-${pkgver}-enable-valid.patch"
+ "02-upstream-${_patchrel}.patch"
+ "03-infinality-${pkgver}-${_patchrel}.patch"
+ xft-settings.sh
+ infinality-settings.sh
+ infinality-settings-generic)
+
+sha1sums=('29c22b85b77cb22cf95c13e7062e21f39fe6b17a'
+ 'abf7a8f726ad6359533651a8942636880febf9f6'
+ '319c377ef4e3f6bc2f52acb893c9b880ef9578b4'
+ 'a19a000e778a0b29b0ef0623d566b12187b7f24a'
+ 'a1859f2eacae2046a9ef705ac2bcc4bdf4fd9717'
+ '5624c40049a73f8c75d01537212b4c7040f1761f'
+ '4d219670cb9641b649f6ba0f2a799006f7c3c3c5')
+
+prepare() {
+ cd "freetype-${pkgver}"
+
+ patches=("01-freetype-${pkgver}-enable-valid.patch"
+ "02-upstream-${_patchrel}.patch"
+ "03-infinality-${pkgver}-${_patchrel}.patch")
+
+ # infinality & post release fixes
+ for patch in "${patches[@]}"; do
+ patch -Np1 -i ${srcdir}/"${patch}"
+ done
+
+}
build() {
- cd "${srcdir}/freetype-${pkgver}"
-
- patch -Np1 -i ../01-freetype-2.6-enable-valid.patch
- patch -Np1 -i ../02-upstream-2015.08.24.patch
- patch -Np1 -i ../03-infinality-2.6-2015.08.24.patch
-
- ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
- make
+ cd "freetype-${pkgver}"
+
+ ./configure \
+ --prefix=/usr \
+ --disable-static \
+ --with-harfbuzz \
+ --with-png
+
+ make
}
+#check() {
+ #cd "freetype-${pkgver}"
+ #make -k check
+#}
+
package() {
- cd "${srcdir}/freetype-${pkgver}"
- make DESTDIR="${pkgdir}" install
- install -D -T "${srcdir}/infinality-settings.sh" "${pkgdir}/etc/profile.d/infinality-settings.sh"
+ cd "freetype-${pkgver}"
+
+ make DESTDIR="${pkgdir}" install
+
+ # freetype2 runtime settings
+ install -m755 -d "${pkgdir}/etc/X11/xinit/xinitrc.d"
+ install -m755 "${srcdir}/xft-settings.sh" \
+ "${pkgdir}/etc/X11/xinit/xinitrc.d/xft-settings.sh"
+
+ install -m755 -d "${pkgdir}/usr/share/doc/freetype2-infinality-ultimate"
+ install -m755 "${srcdir}/infinality-settings.sh" \
+ "${pkgdir}/usr/share/doc/freetype2-infinality-ultimate/infinality-settings.sh"
+ install -m755 "${srcdir}/infinality-settings-generic" \
+ "${pkgdir}/usr/share/doc/freetype2-infinality-ultimate/infinality-settings-generic"
}
diff --git a/infinality-settings-generic b/infinality-settings-generic
new file mode 100644
index 00000000000..a560c15e38d
--- /dev/null
+++ b/infinality-settings-generic
@@ -0,0 +1,1137 @@
+##################################################################
+### INFINALITY ENVIRONMENT VARIABLES FOR EXTRA RUN-TIME OPTIONS ##
+##################################################################
+#
+# These environment variables require that their respective patches
+# from http://www.infinality.net have been applied to the Freetype
+# installation you are using. They will do abolutely
+# nothing otherwise!
+#
+#
+# This file should be copied to /etc/profile.d/ for system-wide
+# effects and/or included in ~/.bashrc or ~/.bash_profile for per-user
+# effects:
+#
+# . ~/path/to/this/file/infinality-settings.sh
+#
+# Of course, the per-user settings will override the system-wide
+# settings. Default values indicated below will be used when the
+# environment variables below are not defined.
+#
+# When I say "Default:" below, I'm referring to the default if no
+# environment variables are set. Generally this ends up being
+# whatever Freetype's default is set to.
+#
+
+
+##################################################################
+# EXAMPLES
+#
+# Please see 3/4 down in this file for examples of different settings.
+#
+
+
+
+
+
+
+#################################################################
+################## EXPLANATION OF SETTINGS ######################
+#################################################################
+
+
+
+##################################################################
+# SET_XFT_SETTINGS
+#
+# Should the below Xft settings be set globally by this script? (true/false)
+
+SET_XFT_SETTINGS=true
+
+# XFT settings are like a red-headed stepchild that should be beaten
+# severely.
+# These only affect legacy programs, and *parts* of some modern programs
+# like google-chrome. We only deal with these settings because we have to,
+# otherwise crap will slip by. I recommend using hintslight and autohint
+# as the defaults normally in /etc/fonts/. The reason hintfull and
+# autohint:0 is needed here because otherwise some programs will
+# occassionally request slight hinting for a truetype font. When a program
+# does this, Freetype automatically uses the autohinter, when you may
+# actually want it to be rendered with the TT hinter, (if specified in
+# /etc/fonts/). So setting this to hintfull guarantees that the TT font
+# will be rendered with the TT hinter (assuming it is specified in
+# /etc/fonts/ to be rendered that way.) For TT fonts that you want
+# rendered with autohint, specifiying that in the /etc/fonts/ should be
+# enough. But you might think that by setting this to hintfull
+# that it's going to use Freetype's full autohinting (which we *completely*
+# avoid) for fonts you want autohinted. This is where
+# INFINALITY_FT_AUTOFIT_FORCE_SLIGHT_HINTING comes in. It tells freetype
+# to use slight hinting on fonts set for autohinting, even if the program
+# requests full autohinting. Freetype's full hinting only looks OK under
+# certain circumstances. The goal of infinality is to make infinality
+# hinting look good all the time.
+
+XFT_SETTINGS="
+Xft.antialias: 1
+Xft.autohint: 0
+Xft.dpi: 96
+Xft.hinting: 1
+Xft.hintstyle: hintfull
+Xft.lcdfilter: lcddefault
+Xft.rgba: rgb
+"
+
+if [ "$SET_XFT_SETTINGS" = "true" ]; then
+ echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1
+fi
+
+
+
+##################################################################
+# INFINALITY_FT_FILTER_PARAMS
+#
+# This is a modified version of the patch here:
+# http://levelsofdetail.kendeeter.com/2008/12/dynamic_fir_filter_patch.html
+#
+# Allows you to adjust the FIR filter at runtime instead of at
+# compile time. The idea is to have values add up to 100, and be
+# symmetrical around the middle value. If the values add up to
+# more than 100, the glyphs will appear darker. If less than 100,
+# lighter. I recommend using this method to make glyphs darker
+# or lighter globally as opposed to using the gamma option (see note in
+# the gamma option).
+#
+# Here are some samples of various filter parameters:
+#
+# (this has been changed to use integers between 0 and 100 to
+# avoid problems with regional differences like comma for decimal point)
+#
+#
+# Strong Extra Smooth "15 20 30 20 15" (extra smooth, natural weight)
+# Extra Smooth "20 20 30 20 20" (extra smooth, extra weight)
+# Smooth "15 20 32 20 15" (smooth, natural weight)
+# Stronger Gibson "11 22 38 22 11" (smooth, extra weight)
+# Gibson "11 22 33 22 11" (smooth, natural weight)
+# Freetype Light "00 33 34 33 00" (sharp, natural weight) # freetype's "light" LCD filter
+# Freetype Default "06 25 44 25 06" (sharp, extra weight) # freetype's default
+# Extra Sharp "00 35 35 35 00" (extra sharp, extra weight) # freetype's "light" LCD filter on acid
+#
+#
+# Windows uses something more sharp, maybe along the lines of Freetype's
+# default
+#
+# Default if no ENV_VARS present: [Freetype's default]
+# Recommended: "11 22 38 22 11" (too dark / smooth for some)
+#
+# Example 1: export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+#
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+
+
+
+##################################################################
+# INFINALITY_FT_STEM_ALIGNMENT_STRENGTH
+#
+# This performs analysis on each glyph and determines an amount
+# to shift the glyph, left or right, so that it aligns better to
+# pixel boundaries.
+#
+# This results in subtley cleaner looking stems, at the expense of
+# proper distances between glyphs. This is only active for sizes
+# 10 px or greater and does not apply to bold or italic fonts.
+#
+# There are also exceptions on a small number of fonts that I've
+# not been able to render nicely with alignment enabled. In those
+# cases, a forced translation is applied instead.
+#
+# Possible values:
+# 0 through 100 - think of as percentage of strength
+#
+# 0 corresponds to no shifting whatsoever. In other words, OFF.
+#
+# 100 corresponds to a full move to a snap zone defined by
+# the snapping algorithm, be it left or right. This
+# is the full amount any glyph could be moved in order to make it
+# align to the pixel.
+#
+# Values inbetween act as caps. If the algorithm determines that it
+# wants to move the glyph .33 of a pixel to the left, but the value
+# is set to 50 (i.e. 50%), then the maximum move that would be allowed
+# is 50% of half a pixel, in other words .25. So instead of .33 the
+# glyph is moved .25 of a pixel.
+#
+# For a subtle effect that doesn't dramatically affect the glyph, use
+# 25 for this and 25 for INFINALITY_FT_STEM_FITTING_STRENGTH
+#
+# Default if no ENV_VARS present: 0
+# Recommended if you want to use it: 100
+
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=25
+
+
+
+##################################################################
+# INFINALITY_FT_STEM_FITTING_STRENGTH
+#
+# This performs analysis on each glyph and determines an amount
+# to horizontally scale the glyph, so that stems align better to
+# pixel boundaries. An emboldening (or anti-emboldening) is
+# performed afterward to account for stem width exaggeration.
+#
+# This results in subtley cleaner looking fonts, at the expense of
+# proper distances between glyphs and slightly misshapen glyphs.
+# This is only active for sizes 10 px or greater and does not
+# apply to bold or italic fonts.
+#
+# There are also exceptions on a small number of fonts that I've
+# not been able to render nicely with fitting enabled. In those
+# cases, a forced translation is applied instead.
+#
+#
+# Possible values:
+# 0 through 100 - think of as percentage of strength
+#
+# 0 corresponds to no stretching whatsoever. In other words, OFF.
+#
+# 100 corresponds to a full pixel stretch, be outward or inward. This
+# is the full amount any glyph could be stretched in order to make it
+# align to a pixel boundary. Which direction is chosen is part
+# of the art of what I'm trying to do in the code. ;)
+#
+#
+# Values inbetween act as caps. If the algorithm determines that it
+# wants to stretch the glyph .75 of a pixel outward, but the value
+# is set to 50 (i.e. 50%), then the maximum move that would be allowed
+# is 50% of a pixel, in other words .50. So instead of .75 the
+# glyph is stretched .50 of a pixel.
+#
+# For a subtle effect that doesn't dramatically affect the glyph, use
+# 25 for this and 25 for INFINALITY_FT_STEM_FITTING_STRENGTH
+#
+# Default if no ENV_VARS present: 0
+# Recommended if you want to use it: 100
+
+export INFINALITY_FT_STEM_FITTING_STRENGTH=25
+
+
+
+##################################################################
+# INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE
+#
+# This allows you to set a ppem at which alignment and fitting
+# will reach 100%. As glyphs become larger, more dramatic
+# snapping will not affect the glyph shape as much, so it makes
+# sense to allow this.
+#
+# For fonts that are 10 ppem, the values set above for
+# INFINALITY_FT_STEM_ALIGNMENT_STRENGTH and
+# INFINALITY_FT_STEM_FITTING_STRENGTH will be used. As the ppem
+# gradually becomes larger, so will the strength settings, and
+# they will reach 100% at the ppem you specify here.
+#
+# This is a simple linear scale.
+#
+# Possible values:
+# 0 means to not use this feature
+#
+# 11 and up will set the 100% level to that ppem value
+#
+# Anything else is officially undefined, but I still bound it internally.
+#
+# Default if no ENV_VARS present: 0
+
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=40
+
+
+
+##################################################################
+# INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS
+#
+# This applies largely to certain MS fonts, but some others as well.
+# it will apply known good settings on a font-by-font basis, regardless
+# of the other settings above or below.
+#
+# - Use known values for selected fonts & ppems that are known to look
+# ok with 100:
+#
+# INFINALITY_FT_STEM_ALIGNMENT_STRENGTH
+# INFINALITY_FT_STEM_FITTING_STRENGTH
+#
+# - Use various internal tweaks like compatible widths and other
+# font-specific hacks.
+# - Use gamma, brightness or contrast adjustments automatically
+# on certain fonts. Global settings will still apply afterwards.
+# - Enable various forced settings on selective fonts during
+# rasterization and stem_alignment.
+#
+# If set to TRUE, this will use 100 regardless of the values you have
+# specified above. It will not affect fonts that are not in this
+# small list.
+#
+# Possible values:
+# FALSE means to not use this feature
+#
+# TRUE will enable this feature
+#
+# Default if no ENV_VARS present: FALSE
+# Recommended: TRUE
+#
+
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+
+
+##################################################################
+# INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH
+#
+# This enables an algorithm found in ChromeOS for sharpening the
+# appearance of glyphs. It is based off this patch:
+#
+# http://codereview.chromium.org/3298011/diff/9001/media-libs/freetype/files/freetype-2.3.11-lcd-sharpen.patches
+#
+# It gives glyphs a more "grainy" look through some gamma
+# correction. It does tend to thin out vertical stems, which
+# may be a feature or a bug depending on your taste ;)
+#
+#
+# Possible values:
+# 0 through 100 - think of as percentage of strength
+#
+# 0 corresponds to no sharpening whatsoever. In other words, OFF.
+#
+# 25 is good for a subtle effect.
+#
+# 50 corresponds to the default ChromeOS value.
+#
+# 100 corresponds to maximum sharpening. This usually results in
+# something undesirable looking.
+#
+#
+# As you increase this amount, it is good to decrease the gamma (2nd value)
+# of INFINALITY_FT_PSEUDO_GAMMA, and possibly increase
+# INFINALITY_FT_STEM_FITTING_STRENGTH and
+# INFINALITY_FT_STEM_ALIGNMENT_STRENGTH, as it seems like the algorithm
+# lightens stems that aren't fully on-pixel.
+#
+# Default if no ENV_VARS present: 0
+# Recommended: If you're going to use this filter - 50
+
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+
+
+
+##################################################################
+# INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH
+#
+# This enables an algorithm developed with the intention to sharpen
+# fonts to look similarly to Windows.
+#
+# It gives glyphs a more "grainy" look, like the ChromeOS filter
+# except it does so more selectively. This prevents the thinning
+# of vertical stems that is noticible when a blanket gamma filter
+# like the ChromeOS filter is applied.
+#
+# I also get a "cleaner" impression from the fonts with this Windows
+# style filter. This filter was done by 100% experimentation,
+# and there things that could probably be improved.
+#
+# Some may argue that I shouldn't be trying to take the shortcomings
+# of the MS approach and bring them here. I disagree, as part
+# of freedom is having the right to make your fonts look as
+# shitty as you'd like.
+#
+# Using this filter does somewhat lessen the need to use stem
+# fitting and stem alignment, as glyphs appear sharper.
+#
+# This setting can be used at the same time as the previous chromeOS
+# sharpening, and happens after it in the code.
+#
+#
+# Possible values:
+# 0 through 100 - think of as percentage of strength
+#
+# 0 corresponds to no sharpening whatsoever. In other words, OFF.
+#
+# 10-25 is good for a subtle effect while not completely decimating glyphs.
+#
+# 50-75 corresponds to probably something in the range that Windows uses.
+#
+# 100 corresponds to maximum sharpening.
+#
+#
+# Using a high value for this variable along with enabling the
+# fringe filter (below) almost eliminates the need
+# for INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT to be set to 100,
+# and can instead be set at 0. (Setting
+# INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT to 0 prevents missing
+# stems in the middle of s. The drawback is that many fonts just look
+# way too sharp and grainy at this setting. Your call.)
+#
+# Default if no ENV_VARS present: 0
+# Recommended if you want to use this filter: 65
+
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=10
+
+
+
+##################################################################
+# INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT
+#
+# When using autohinting, horizontal stems you'd find in E, f, T, -,
+# etc. are normally not snapped to full integer pixel heights, meaning
+# that you will get a semi-dark fringe on these stems, above or
+# below the black line of pixels:
+#
+# ##########
+# ##
+# ##-------
+# #########
+# ##
+# ##--------
+# ##########
+#
+# (- represents the semi-dark pixels)
+#
+# Setting this to 100 will force integer pixel heights. Setting it to
+# zero will do what Freetype does by default. Anything inbetween will
+# act as a weighted average of the two.
+#
+# This is disabled when the standard width is found (via voodoo) to be
+# less than 1 pixel, in order to prevent the vanishing stem issues on
+# letters with diagonal stems like a and s.
+#
+# Under most circumstances, this should be set at 100. If you choose to
+# not set it to 100, you may want to set INFINALITY_FT_FRINGE_FILTER_STRENGTH
+# to a non-zero value in order to reduce fringing.
+#
+#
+# Possible values:
+# 0 - default Freetype value
+# 100 - a full pixel
+#
+#
+# Default if no ENV_VARS present: 0
+# Recommended: 100
+
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+
+
+
+##################################################################
+# INFINALITY_FT_USE_VARIOUS_TWEAKS
+#
+# - Force autohint when no TT instructions present.
+# - Artificially embolden horizontally only.
+# - When artificially emboldening, maintain the glyph width.
+# - Embolden light and thin-stemmed glyphs automatically.
+# - Don't sharpen italics.
+#
+# Some fonts look bad when stem aligned at certain ppems, no matter
+# what. I've put exceptions in to deal with these, included in
+# these tweaks. Georgia and Lucida Grande are examples.
+#
+#
+# Possible values:
+# true - enable tweaks
+# false - do not enable tweaks (do Freetype default)
+#
+#
+# Default if no ENV_VARS present: false
+# Recommended: true
+
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+
+
+
+##################################################################
+# INFINALITY_FT_GAMMA_CORRECTION
+#
+# This does a weighted gamma correction at the LCD filter phase
+# PRIOR to the LCD filter. Unfortunately it does not however
+# take into account the color on which the glyph is being rendered
+# (or for that matter the color of the glyph),
+# which would need to happen in X rendering. It is actually
+# using the gamma function in calculations though.
+#
+# The first value indicates a px value, the second indicates a
+# "gamma" value. All sizes less than the px value will be corrected
+# on a weighted scale based on the second value.
+#
+# The gamma value is commonly between 0.0 and 3.0. Due to localization
+# issues, the gamma value should be specified as it's actual value
+# multiplied by 100. So a gamma of 1.3 would be 130. In practice,
+# I'd stay between 40 and 250.
+#
+#
+# Values 1 through 100 will darken the glyph
+# Values greater than 100 will lighten the glyph
+#
+#
+# Example 1: Darken glyphs that are less than 10 px. With some fonts
+# even 5 or 6px is readable!
+# export INFINALITY_FT_GAMMA_CORRECTION="10 60"
+#
+# Example 2: Lighten all glyphs (below 100px)
+# export INFINALITY_FT_GAMMA_CORRECTION="100 150"
+#
+# Example 3: Do nothing
+# export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+#
+# Default: [No gamma correction]
+
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+
+
+
+##################################################################
+# INFINALITY_FT_BRIGHTNESS
+#
+# This filter adjusts brightness, using the standard algorithm
+# for brightness. It is applied AFTER the LCD filtering.
+#
+# For a Windows XP look, set brightness to something and contrast to 50
+# This will also tend to increase its sharpness.
+# These values are relative and don't really mean anything
+# however they are satisfactory for a range of appearances.
+# Another tip is to use a gamma setting of "1000 110" or something
+# over 100 to lighten things before processing.
+#
+# Default if no ENV_VARS present: 0
+# Dark XP Experience: -25
+# Light XP Experience: 40
+#
+# Example: export INFINALITY_FT_BRIGHTNESS="-20"
+
+export INFINALITY_FT_BRIGHTNESS="0"
+
+
+
+##################################################################
+# INFINALITY_FT_CONTRAST
+#
+# This filter adjusts contrast, using the standard algorithm
+# for contrast. It is applied AFTER the LCD filtering.
+#
+# For a Windows XP look, set brightness to -25 and contrast to 50
+# This will also tend to increase its sharpness.
+# These values are relative and don't really mean anything
+# however they are satisfactory for a range of appearances.
+# Another tip is to use a gamma setting of "1000 110" or something
+# over 100 to lighten things before processing.
+#
+# Default if no ENV_VARS present: 0
+# Dark or Light XP Experience: 50
+#
+# Example: export INFINALITY_FT_CONTRAST="50"
+
+export INFINALITY_FT_CONTRAST="0"
+
+
+
+##################################################################
+# INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH
+#
+# This filter adjusts subpixel-rendered glyphs toward grayscale.
+# Sometimes this is useful in getting a rendering more like
+# OSX.
+#
+# Range: Integers 0 through 100
+# 0 represents no filtering
+# 50 represents halfway between subpixel and grayscale
+# 100 represents completely grayscale
+#
+# Default if no ENV_VARS present: 0
+# Recommended, if you want to use it: 30
+#
+# Example: export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="33"
+
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="0"
+
+
+
+##################################################################
+# INFINALITY_FT_FRINGE_FILTER_STRENGTH
+#
+# This filter tries to remove the horizontal fringing that is found on
+# default autohinted glyphs (similar to OSX-rendered glyphs).
+# For example, an E may be rendered so that the middle horizontal
+# stem is 100% black, but also has a horizonal row of pixels above
+# it that is at 50% intensity. This makes the glyph look dirty,
+# however it is technically accurate.
+#
+# This would be useful in cases where you have
+# INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT set to something less than 100
+# but also can affect glyphs at 100, to some degree.
+#
+# Unless fonts are showing fringes in a way that annoys you, I recommend
+# keeping it disabled, as it can slightly interfere with smooth appearance
+# sometimes.
+#
+#
+# Range: Integers 0 through 100
+# 0 represents no filtering
+# 50 represents a 50% reduction of detected fringes
+# 100 represents completely removing detected fringes
+#
+#
+# Default if no ENV_VARS present: 0
+# Recommended, if you want to use it: 100
+#
+# Example: export INFINALITY_FT_FRINGE_FILTER_STRENGTH="100"
+
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH="0"
+
+
+
+##################################################################
+# INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH
+#
+# This post-filter darkens horizontal stems that autohint renders as semi-dark.
+# Freetype will by default not force stems to render to pixel boundaries
+# because it results in "vanishing stems". This happens on things like
+# s S a and other glyphs with center diagonal stems.
+#
+# If you have INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT set to 100,
+# you're telling it to force pixel boundaries, which can result in the
+# vanishing stems. To get around this problem, I internally override the
+# INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT setting if the stem width
+# is less than a full pixel, regardless. This causes semi-dark stems, but
+# at least there are stems there.
+#
+# This filter is intended to darken those semi-dark stems. I highly
+# recommend using this, but setting to a low value like 10, because
+# it is particularly sensitive right now, and can make thin fonts
+# look weird otherwise.
+#
+#
+# Range: Integers 0 through 100
+# 0 represents no darkening
+# 50 represents a 50% increase toward 1 pixel in height
+# 100 represents a full pixel of height
+#
+#
+# Default if no ENV_VARS present: 0
+# Recommended, if you want to use it: 10
+#
+# Example: export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="10"
+
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="10"
+
+
+
+##################################################################
+# INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH
+#
+# This post-filter darkens vertical stems less than 1 pixel that autohint
+# renders as semi-dark. This applies mostly to thin fonts like
+# Courier New, Raleway, and fonts with the word "Light" in the title or
+# style. Although what autohint is doing is technically correct, it
+# results in a bad looking rendering because it's too light, at small
+# ppems. This filter tries to correct that.
+#
+# There is an aspect of this that is automatic, so it's safer to use
+# larger values for this than the above horizontal ENV_VAR. However
+# setting this higher has more impact on thinner fonts. So, I still
+# recommend lower values.
+#
+#
+# Range: Integers 0 through 100
+# 0 represents no darkening
+# 50 represents a 50% increase (from current strength) toward 1 pixel
+# 100 represents a full pixel of width
+#
+#
+# Default if no ENV_VARS present: 0
+# Recommended, if you want to use it: 25
+#
+# Example: export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="25"
+
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="25"
+
+
+
+##################################################################
+# INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS
+#
+# This will slightly stretch some glyphs vertically between 9px
+# and 14px (inclusive). Some people may find this more
+# aesthetically pleasing. This only applies to fonts that are
+# using autohint. I used to recommend this to be set true, but
+# it does mess with some (less popular) glyphs in a nasty way.
+#
+# The goal here is to increase the height of some fonts by 1 px
+# but leave the x-height where it is. Arial is a good example
+# of this working properly. Compare the heights of Arial, Times
+# and Freesans with this on, vs. TT hinted versions of Arial and
+# Times.
+#
+#
+# Possible values:
+# true - enable height adjustment
+# false - do not enable height adjustment
+#
+#
+# Default: false
+
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+
+
+# Experimental emboldening values for OSX mode
+export INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE=0
+export INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE=0
+export INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0 # This one seems to crash at anything other than 0
+export INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0
+
+#################################################################
+########################### EXAMPLES ############################
+#################################################################
+#
+# Set the USE_STYLE variable below to try each example.
+# Make sure to set your style in /etc/fonts/infinality.conf too.
+#
+# Possible options:
+#
+# DEFAULT - Use above settings. A compromise that should please most people.
+# OSX - Simulate OSX rendering
+# IPAD - Simulate iPad rendering
+# UBUNTU - Simulate Ubuntu rendering
+# LINUX - Generic "Linux" style - no snapping or certain other tweaks
+# WINDOWS - Simulate Windows rendering
+# WINDOWS7 - Simulate Windows rendering with normal glyphs
+# WINDOWS7LIGHT - Simulate Windows 7 rendering with lighter glyphs
+# WINDOWS - Simulate Windows rendering
+# VANILLA - Just subpixel hinting
+# CUSTOM - Your own choice. See below
+# ----- Infinality styles -----
+# CLASSIC - Infinality rendering circa 2010. No snapping.
+# NUDGE - CLASSIC with lightly stem snapping and tweaks
+# PUSH - CLASSIC with medium stem snapping and tweaks
+# SHOVE - Full stem snapping and tweaks without sharpening
+# SHARPENED - Full stem snapping, tweaks, and Windows-style sharpening
+# INFINALITY - Settings I use
+# DISABLED - Act as though running without the extra infinality enhancements (just subpixel hinting).
+
+USE_STYLE="DEFAULT"
+
+
+
+### WARNING - NEEDS WORK - ALSO LIABLE TO CRASH APPLICATIONS ###
+################# OSX STYLE #################
+if [ "$USE_STYLE" = "OSX" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="03 32 38 32 03"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=25
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="1000 80"
+export INFINALITY_FT_BRIGHTNESS="10"
+export INFINALITY_FT_CONTRAST="20"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=false
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+export INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE=0
+export INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE=8
+export INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0
+export INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0
+
+fi
+
+
+
+################# IPAD STYLE #################
+if [ "$USE_STYLE" = "IPAD" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="00 00 100 00 00"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=100
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="1000 80"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=false
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+export INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE=0
+export INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE=0
+export INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0
+export INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0
+
+fi
+
+
+
+################# UBUNTU STYLE #################
+if [ "$USE_STYLE" = "UBUNTU" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="1000 80"
+export INFINALITY_FT_BRIGHTNESS="-10"
+export INFINALITY_FT_CONTRAST="15"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+
+################# LINUX STYLE #################
+if [ "$USE_STYLE" = "LINUX" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+################# WINDOWS XP STYLE LIGHT #################
+if [ "$USE_STYLE" = "WINDOWSXPLIGHT" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=100
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=65
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=15
+export INFINALITY_FT_STEM_FITTING_STRENGTH=15
+export INFINALITY_FT_GAMMA_CORRECTION="1000 120"
+export INFINALITY_FT_BRIGHTNESS="20"
+export INFINALITY_FT_CONTRAST="30"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=30
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# WINDOWS 7 STYLE LIGHT #################
+if [ "$USE_STYLE" = "WINDOWS7LIGHT" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="20 25 38 25 05"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=100
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=100
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="1000 160"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="20"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=30
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# WINDOWS XP STYLE #################
+if [ "$USE_STYLE" = "WINDOWSXP" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="06 25 44 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=100
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=65
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=15
+export INFINALITY_FT_STEM_FITTING_STRENGTH=15
+export INFINALITY_FT_GAMMA_CORRECTION="1000 120"
+export INFINALITY_FT_BRIGHTNESS="10"
+export INFINALITY_FT_CONTRAST="20"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=30
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# WINDOWS 7 STYLE #################
+if [ "$USE_STYLE" = "WINDOWS7" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="20 25 42 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=100
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=65
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="1000 120"
+export INFINALITY_FT_BRIGHTNESS="10"
+export INFINALITY_FT_CONTRAST="20"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+############### VANILLA STYLE ##############
+if [ "$USE_STYLE" = "VANILLA" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=false
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=0
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+############### CLASSIC INFINALITY STYLE ##############
+if [ "$USE_STYLE" = "CLASSIC" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="06 25 38 25 06"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=0
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=0
+export INFINALITY_FT_STEM_FITTING_STRENGTH=0
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+################# NUDGE STYLE #################
+if [ "$USE_STYLE" = "NUDGE" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=25
+export INFINALITY_FT_STEM_FITTING_STRENGTH=15
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=30
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+################# PUSH STYLE #################
+if [ "$USE_STYLE" = "PUSH" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=75
+export INFINALITY_FT_STEM_FITTING_STRENGTH=50
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=30
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# INFINALITY STYLE #################
+if [ "$USE_STYLE" = "INFINALITY" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=5
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=25
+export INFINALITY_FT_STEM_FITTING_STRENGTH=25
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=40
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# SHOVE STYLE #################
+if [ "$USE_STYLE" = "SHOVE" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=100
+export INFINALITY_FT_STEM_FITTING_STRENGTH=100
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# SHARPENED INFINALITY STYLE #################
+if [ "$USE_STYLE" = "SHARPENED" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=65
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=25
+export INFINALITY_FT_STEM_FITTING_STRENGTH=25
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=40
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
+
+################# DISABLED STYLE #################
+if [ "$USE_STYLE" = "DISABLED" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS=
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=
+export INFINALITY_FT_STEM_FITTING_STRENGTH=
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=false
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=false
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=false
+
+fi
+
+
+################# CUSTOM STYLE #################
+if [ "$USE_STYLE" = "CUSTOM" ]; then
+
+export INFINALITY_FT_FILTER_PARAMS="11 22 38 22 11"
+export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH=0
+export INFINALITY_FT_FRINGE_FILTER_STRENGTH=0
+export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH=10
+export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH=25
+export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH=0
+export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH=100
+export INFINALITY_FT_STEM_FITTING_STRENGTH=100
+export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+export INFINALITY_FT_BRIGHTNESS="0"
+export INFINALITY_FT_CONTRAST="0"
+export INFINALITY_FT_USE_VARIOUS_TWEAKS=true
+export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS=true
+export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT=100
+export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE=0
+export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS=true
+
+fi
+
diff --git a/infinality-settings.sh b/infinality-settings.sh
index f293c652ead..3651817fe2c 100755
--- a/infinality-settings.sh
+++ b/infinality-settings.sh
@@ -1,48 +1,74 @@
+#!/bin/bash
+
### freetype2-infinality-ultimate settings ###
-### rev. 0.4.8.3, for freetype2 v.2.5.x ###
+### rev. 0.4.9.0, for freetype2 v.2.6.2 ###
### ###
-### Copyright (c) 2014 bohoomil ###
+### Copyright (c) 2015 bohoomil ###
### The MIT License (MIT) http://opensource.org/licenses/MIT ###
### part of infinality-bundle http://bohoomil.com ###
-XFT_SETTINGS="
-Xft.antialias: 1
-Xft.autohint: 0
-Xft.dpi: 96
-Xft.hinting: 1
-Xft.hintstyle: hintfull
-Xft.lcdfilter: lcddefault
-Xft.rgba: rgb
-"
-
-echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1
+### As of version 2.6.2-1, freetype2-infinality-ultimate comes with
+### the "ultimate3" rendering style enabled internally by default.
+### It is still possible to use the optional "infinality-settings.sh"
+### script to switch between additional built-in rendering schemes and
+### create custom ones if necessary. Once modified, "infinality-settings.sh"
+### needs to be copied to "/etc/X11/xinit/xinitrc.d/".
+###
+### There are three basic levels of customization available to a user:
+###
+### 1. A set of 7 preconfigured styles selectable by name.
### Available styles:
-### 1 <> extra sharp
-### 2 <> sharper & lighter ultimate
-### 3 <> ultimate: well balanced (default)
-### 4 <> darker & smoother
-### 5 <> darkest & heaviest ("MacIsh")
-
-USE_STYLE="3"
-
-if [ "$USE_STYLE" = "1" ]; then
- export INFINALITY_FT_FILTER_PARAMS="04 22 38 22 04"
-elif [ "$USE_STYLE" = "2" ]; then
- export INFINALITY_FT_FILTER_PARAMS="06 22 36 22 06"
-elif [ "$USE_STYLE" = "3" ]; then
- export INFINALITY_FT_FILTER_PARAMS="08 24 36 24 08"
-elif [ "$USE_STYLE" = "4" ]; then
- export INFINALITY_FT_FILTER_PARAMS="10 25 37 25 10"
-elif [ "$USE_STYLE" = "5" ]; then
- export INFINALITY_FT_FILTER_PARAMS="12 28 42 28 12"
-fi
-
-export INFINALITY_FT_FRINGE_FILTER_STRENGTH="25"
-export INFINALITY_FT_USE_VARIOUS_TWEAKS="true"
-export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="25"
-export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15"
-export INFINALITY_FT_STEM_FITTING_STRENGTH="15"
+### ultimate1 <> extra sharp
+### ultimate2 <> sharper & lighter ultimate
+### ultimate3 <> ultimate: well balanced (default)
+### ultimate4 <> darker & smoother
+### ultimate5 <> darkest & heaviest ("MacIsh")
+### osx <> Apple OS X
+### windowsxp <> MS Windows XP
+### custom <> user defined
+
+### If you want to use a style from the list, uncomment the variable below
+### and set its name as the value.
+
+
+#INFINALITY_FT="ultimate3"
+
+
+### 2. Additionally, the chosen style can be adjusted by setting custom
+### filter parameters. If you want to use this functionality, uncomment
+### the variable below and enter custom values.
+
+
+#export INFINALITY_FT_FILTER_PARAMS="08 24 36 24 08"
+
+
+### 3. Setting the rendering style to "custom" lets you create custom styles
+### from scratch. Uncomment the variables below and enter the values
+### of your choice.
+
+
+#export INFINALITY_FT_FILTER_PARAMS="08 24 36 24 08"
+#export INFINALITY_FT_GRAYSCALE_FILTER_STRENGTH="0"
+#export INFINALITY_FT_FRINGE_FILTER_STRENGTH="25"
+#export INFINALITY_FT_AUTOHINT_HORIZONTAL_STEM_DARKEN_STRENGTH="0"
+#export INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH="25"
+#export INFINALITY_FT_WINDOWS_STYLE_SHARPENING_STRENGTH="25"
+#export INFINALITY_FT_CHROMEOS_STYLE_SHARPENING_STRENGTH="0"
+#export INFINALITY_FT_STEM_ALIGNMENT_STRENGTH="15"
+#export INFINALITY_FT_STEM_FITTING_STRENGTH="15"
+#export INFINALITY_FT_GAMMA_CORRECTION="0 100"
+#export INFINALITY_FT_BRIGHTNESS="0"
+#export INFINALITY_FT_CONTRAST="0"
+#export INFINALITY_FT_USE_VARIOUS_TWEAKS="true"
+#export INFINALITY_FT_AUTOHINT_INCREASE_GLYPH_HEIGHTS="false"
+#export INFINALITY_FT_AUTOHINT_SNAP_STEM_HEIGHT="0"
+#export INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE="0"
+#export INFINALITY_FT_USE_KNOWN_SETTINGS_ON_SELECTED_FONTS="false"
+
+
+### Please refer to "infinality-settings-generic" file for detailed explanation
+### of customization options and provided examples.
# vim:ft=sh:
diff --git a/infinality.install b/infinality.install
new file mode 100644
index 00000000000..f5b9dec3850
--- /dev/null
+++ b/infinality.install
@@ -0,0 +1,18 @@
+
+post_install() {
+ cat << EOF
+ If you are using [multilib], please install/upgrade
+ lib32-freetype2-infinality-ultimate, too.
+EOF
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ cat << EOF
+ freetype2-infinality-ultimate was removed.
+EOF
+}
+# vim:set ts=2 sw=2 et:
diff --git a/install.sh b/install.sh
deleted file mode 100644
index 0924737fe07..00000000000
--- a/install.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-post_install() {
- cat <<- EOF
- ==> Infinality environment variables are located in the file /etc/profile.d/infinality-settings.sh. Change it according to your taste.
- ==> Fontconfig files have moved to fontconfig-infinality package which should be installed and configured separately.
- ==> For best experience, install either Windows, Apple or Google fonts. More information is available at http://www.infinality.net.
- EOF
-}
-
-post_upgrade() {
- post_install $0
-}
diff --git a/xft-settings.sh b/xft-settings.sh
new file mode 100755
index 00000000000..3caf1a7ab35
--- /dev/null
+++ b/xft-settings.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+XFT_SETTINGS="
+Xft.antialias: 1
+Xft.autohint: 0
+Xft.dpi: 96
+Xft.hinting: 1
+Xft.hintstyle: hintfull
+Xft.lcdfilter: lcddefault
+Xft.rgba: rgb
+"
+
+echo "$XFT_SETTINGS" | xrdb -merge > /dev/null 2>&1
+
+# vim:ft=sh: