summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2012-08-28 22:24:56 -0700
committerSteve Kondik <shade@chemlab.org>2012-08-29 00:08:19 -0700
commit4d3876eef9f90a75f2ae55e880759937482e6b3f (patch)
treed11d43d70415c861aabf09e1c77a2fc6c49cfd8e /include
parent8bef833fa7b6f73a362a99dcaa83ee5a98f58e4d (diff)
downloadandroid_external_freetype-4d3876eef9f90a75f2ae55e880759937482e6b3f.tar.gz
android_external_freetype-4d3876eef9f90a75f2ae55e880759937482e6b3f.tar.bz2
android_external_freetype-4d3876eef9f90a75f2ae55e880759937482e6b3f.zip
freetype: Add Infinality patchesjellybean-stablejellybean
* See here for details: * http://www.infinality.net/blog/infinality-freetype-patches/ Change-Id: I4f747e45332fc7f16fb22ac3499069519017035f
Diffstat (limited to 'include')
-rw-r--r--include/freetype/config/ftoption.h35
-rw-r--r--include/freetype/internal/ftobjs.h8
2 files changed, 42 insertions, 1 deletions
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 4414cb0..e4b99c2 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -92,7 +92,7 @@ FT_BEGIN_HEADER
/* This is done to allow FreeType clients to run unmodified, forcing */
/* them to display normal gray-level anti-aliased glyphs. */
/* */
-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
/*************************************************************************/
@@ -560,6 +560,39 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
+ /* Define TT_CONFIG_OPTION_SUBPIXEL_HINTING if you want to compile */
+ /* EXPERIMENTAL subpixel hinting support into the TrueType driver. This */
+ /* replaces the native TrueType hinting mechanism when anything but */
+ /* FT_RENDER_MODE_MONO is requested. */
+ /* */
+ /* Enabling this causes the TrueType driver to ignore instructions under */
+ /* certain conditions. This is done in accordance with the guide here, */
+ /* with some minor differences: */
+ /* */
+ /* http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx */
+ /* */
+ /* By undefining this, you only compile the code necessary to hint */
+ /* TrueType glyphs with native TT hinting. */
+ /* */
+ /* This option requires TT_CONFIG_OPTION_BYTECODE_INTERPRETER to be */
+ /* defined. */
+ /* */
+#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
+
+
+ /*************************************************************************/
+ /* */
+ /* Define FT_CONFIG_OPTION_INFINALITY_PATCHSET if you want to enable */
+ /* all additional infinality patches, which are configured via env */
+ /* variables. */
+ /* */
+ /* This option requires TT_CONFIG_OPTION_SUBPIXEL_HINTING to */
+ /* defined. */
+ /* */
+#define FT_CONFIG_OPTION_INFINALITY_PATCHSET
+
+ /*************************************************************************/
+ /* */
/* If you define TT_CONFIG_OPTION_UNPATENTED_HINTING, a special version */
/* 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/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index eee3d24..d4da5da 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -81,6 +81,14 @@ FT_BEGIN_HEADER
#define FT_PIX_ROUND( x ) FT_PIX_FLOOR( (x) + 32 )
#define FT_PIX_CEIL( x ) FT_PIX_FLOOR( (x) + 63 )
+ /*
+ * These are used in ttinterp.c for subpixel hinting with an
+ * adjustable grids-per-pixel value.
+ */
+#define FT_PIX_FLOOR_GRID( x, n ) ( (x) & ~( 64 / (n) - 1 ) )
+#define FT_PIX_ROUND_GRID( x, n ) FT_PIX_FLOOR_GRID( (x) + 32 / (n), (n) )
+#define FT_PIX_CEIL_GRID( x, n ) FT_PIX_FLOOR_GRID( (x) + 63 / (n), (n) )
+
/*
* Return the highest power of 2 that is <= value; this correspond to