summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexei Podtelezhnikov <apodtele@gmail.com>2020-05-12 00:38:46 -0400
committerAlexei Podtelezhnikov <apodtele@gmail.com>2020-05-12 00:38:46 -0400
commit3f70e6d20c82b28174096adcd0657b3c998b007b (patch)
tree761a66d3938ecd00d26afecbc33fc257a3d35306
parent652f88631932713309b6fa2cf12669699e3fc8e6 (diff)
downloadfreetype2-3f70e6d20c82b28174096adcd0657b3c998b007b.tar.gz
[smooth] Turn on LCD filtering during FreeType initialization.
* src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering. * include/freetype/ftlcdfil.h: Document it, remove patent warnings. * include/freetype/freetype.h (FT_Render_Mode): Updated. * include/freetype/config/ftoption.h, devel/ftoption.h [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents.
-rw-r--r--ChangeLog11
-rw-r--r--devel/ftoption.h6
-rw-r--r--include/freetype/config/ftoption.h6
-rw-r--r--include/freetype/freetype.h8
-rw-r--r--include/freetype/ftlcdfil.h27
-rw-r--r--src/smooth/ftsmooth.c2
6 files changed, 28 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index c69edde93..ae91a4ac5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2020-05-12 Alexei Podtelezhnikov <apodtele@gmail.com>
+
+ [smooth] Turn on LCD filtering during FreeType initialization.
+
+ * src/smooth/ftsmooth.c (ft_smooth_init): Enable LCD filtering.
+
+ * include/freetype/ftlcdfil.h: Document it, remove patent warnings.
+ * include/freetype/freetype.h (FT_Render_Mode): Updated.
+ * include/freetype/config/ftoption.h, devel/ftoption.h
+ [FT_CONFIG_OPTION_SUBPIXEL_RENDERING]: Do not mention patents.
+
2020-05-11 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Stop using dedicated LCD modules and classes.
diff --git a/devel/ftoption.h b/devel/ftoption.h
index c234de391..da53cf2fa 100644
--- a/devel/ftoption.h
+++ b/devel/ftoption.h
@@ -121,10 +121,8 @@ FT_BEGIN_HEADER
* mitigate color fringes inherent to this technology, you also need to
* explicitly set up LCD filtering.
*
- * Note that this feature is covered by several Microsoft patents and
- * should not be activated in any default build of the library. When this
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
+ * When this macro is not defined, FreeType offers alternative LCD
+ * rendering technology that produces excellent output.
*/
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 426806d2e..73470a075 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -121,10 +121,8 @@ FT_BEGIN_HEADER
* mitigate color fringes inherent to this technology, you also need to
* explicitly set up LCD filtering.
*
- * Note that this feature is covered by several Microsoft patents and
- * should not be activated in any default build of the library. When this
- * macro is not defined, FreeType offers alternative LCD rendering
- * technology that produces excellent output without LCD filtering.
+ * When this macro is not defined, FreeType offers alternative LCD
+ * rendering technology that produces excellent output.
*/
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 973264b12..6af7557d9 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -3246,14 +3246,6 @@ FT_BEGIN_HEADER
* pixels and use the @FT_PIXEL_MODE_LCD_V mode.
*
* @note:
- * Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
- * `ftoption.h`, which enables patented ClearType-style rendering, the
- * LCD-optimized glyph bitmaps should be filtered to reduce color fringes
- * inherent to this technology. You can either set up LCD filtering with
- * @FT_Library_SetLcdFilter or @FT_Face_Properties, or do the filtering
- * yourself. The default FreeType LCD rendering technology does not
- * require filtering.
- *
* The selected render mode only affects vector glyphs of a font.
* Embedded bitmaps often have a different pixel mode like
* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them
diff --git a/include/freetype/ftlcdfil.h b/include/freetype/ftlcdfil.h
index c5516d0e0..8ecaab82e 100644
--- a/include/freetype/ftlcdfil.h
+++ b/include/freetype/ftlcdfil.h
@@ -47,7 +47,7 @@ FT_BEGIN_HEADER
* @description:
* FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
- * `ftoption.h` file, this enables patented ClearType-style rendering.
+ * `ftoption.h` file, this enables ClearType-style rendering.
* Otherwise, Harmony LCD rendering is enabled. These technologies are
* controlled differently and API described below, although always
* available, performs its function when appropriate method is enabled
@@ -177,7 +177,7 @@ FT_BEGIN_HEADER
* FT_Library_SetLcdFilter
*
* @description:
- * This function is used to apply color filtering to LCD decimated
+ * This function is used to change filter applied to LCD decimated
* bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
*
@@ -196,15 +196,14 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * This feature is always disabled by default. Clients must make an
- * explicit call to this function with a `filter` value other than
- * @FT_LCD_FILTER_NONE in order to enable it.
+ * Since 2.11 the LCD filtering is enabled with @FT_LCD_FILTER_DEFAULT.
+ * It is no longer necessary to call this function explicitly except
+ * to choose a different filter or disable filtering altogether with
+ * @FT_LCD_FILTER_NONE.
*
- * Due to **PATENTS** covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature` if the
- * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
+ * This function does nothing but returns `FT_Err_Unimplemented_Feature`
+ * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
+ * not defined in your build of the library.
*
* @since:
* 2.3.0
@@ -235,11 +234,9 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
- * Due to **PATENTS** covering subpixel rendering, this function doesn't
- * do anything except returning `FT_Err_Unimplemented_Feature` if the
- * configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not
- * defined in your build of the library, which should correspond to all
- * default builds of FreeType.
+ * This function does nothing but returns `FT_Err_Unimplemented_Feature`
+ * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
+ * not defined in your build of the library.
*
* LCD filter weights can also be set per face using @FT_Face_Properties
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 500e3634a..1a0045ab7 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -44,7 +44,7 @@
sub[2].x = 21;
sub[2].y = 0;
-#elif 0 /* or else, once ClearType patents expire */
+#else /* set up default LCD filtering */
FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );