[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>
[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
* 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 */

View File

@ -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 */

View File

@ -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

View File

@ -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.

View File

@ -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 );