[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.
This commit is contained in:
Alexei Podtelezhnikov 2020-05-12 00:38:46 -04:00
parent 652f886319
commit 3f70e6d20c
6 changed files with 28 additions and 32 deletions

View File

@ -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> 2020-05-11 Alexei Podtelezhnikov <apodtele@gmail.com>
[smooth] Stop using dedicated LCD modules and classes. [smooth] Stop using dedicated LCD modules and classes.

View File

@ -121,10 +121,8 @@ FT_BEGIN_HEADER
* mitigate color fringes inherent to this technology, you also need to * mitigate color fringes inherent to this technology, you also need to
* explicitly set up LCD filtering. * explicitly set up LCD filtering.
* *
* Note that this feature is covered by several Microsoft patents and * When this macro is not defined, FreeType offers alternative LCD
* should not be activated in any default build of the library. When this * rendering technology that produces excellent output.
* macro is not defined, FreeType offers alternative LCD rendering
* technology that produces excellent output without LCD filtering.
*/ */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ /* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */

View File

@ -121,10 +121,8 @@ FT_BEGIN_HEADER
* mitigate color fringes inherent to this technology, you also need to * mitigate color fringes inherent to this technology, you also need to
* explicitly set up LCD filtering. * explicitly set up LCD filtering.
* *
* Note that this feature is covered by several Microsoft patents and * When this macro is not defined, FreeType offers alternative LCD
* should not be activated in any default build of the library. When this * rendering technology that produces excellent output.
* macro is not defined, FreeType offers alternative LCD rendering
* technology that produces excellent output without LCD filtering.
*/ */
/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ /* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */

View File

@ -3246,14 +3246,6 @@ FT_BEGIN_HEADER
* pixels and use the @FT_PIXEL_MODE_LCD_V mode. * pixels and use the @FT_PIXEL_MODE_LCD_V mode.
* *
* @note: * @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. * The selected render mode only affects vector glyphs of a font.
* Embedded bitmaps often have a different pixel mode like * Embedded bitmaps often have a different pixel mode like
* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them * @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them

View File

@ -47,7 +47,7 @@ FT_BEGIN_HEADER
* @description: * @description:
* FreeType provides two alternative subpixel rendering technologies. * FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your * 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 * Otherwise, Harmony LCD rendering is enabled. These technologies are
* controlled differently and API described below, although always * controlled differently and API described below, although always
* available, performs its function when appropriate method is enabled * available, performs its function when appropriate method is enabled
@ -177,7 +177,7 @@ FT_BEGIN_HEADER
* FT_Library_SetLcdFilter * FT_Library_SetLcdFilter
* *
* @description: * @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 * bitmaps, like the ones used when calling @FT_Render_Glyph with
* @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V. * @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
* *
@ -196,15 +196,14 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* This feature is always disabled by default. Clients must make an * Since 2.11 the LCD filtering is enabled with @FT_LCD_FILTER_DEFAULT.
* explicit call to this function with a `filter` value other than * It is no longer necessary to call this function explicitly except
* @FT_LCD_FILTER_NONE in order to enable it. * to choose a different filter or disable filtering altogether with
* @FT_LCD_FILTER_NONE.
* *
* Due to **PATENTS** covering subpixel rendering, this function doesn't * This function does nothing but returns `FT_Err_Unimplemented_Feature`
* do anything except returning `FT_Err_Unimplemented_Feature` if the * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not * not defined in your build of the library.
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
* *
* @since: * @since:
* 2.3.0 * 2.3.0
@ -235,11 +234,9 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success. * FreeType error code. 0~means success.
* *
* @note: * @note:
* Due to **PATENTS** covering subpixel rendering, this function doesn't * This function does nothing but returns `FT_Err_Unimplemented_Feature`
* do anything except returning `FT_Err_Unimplemented_Feature` if the * if the configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is
* configuration macro `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` is not * not defined in your build of the library.
* defined in your build of the library, which should correspond to all
* default builds of FreeType.
* *
* LCD filter weights can also be set per face using @FT_Face_Properties * LCD filter weights can also be set per face using @FT_Face_Properties
* with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS. * with @FT_PARAM_TAG_LCD_FILTER_WEIGHTS.

View File

@ -44,7 +44,7 @@
sub[2].x = 21; sub[2].x = 21;
sub[2].y = 0; 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 ); FT_Library_SetLcdFilter( render->root.library, FT_LCD_FILTER_DEFAULT );