Add `FT_LCD_FILTER_LEGACY1' enum value. This does the same as `FT_LCD_FILTER_LEGACY'. See https://bugs.freedesktop.org/show_bug.cgi?id=92981 for the reasoning. * include/freetype/ftlcdfil.h (FT_LcdFilter): New value `FT_LCD_FILTER_LEGACY1'. * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Use it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
diff --git a/ChangeLog b/ChangeLog
index f62d5de..bcf3123 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2015-11-20 Werner Lemberg <wl@gnu.org>
+
+ Add `FT_LCD_FILTER_LEGACY1' enum value.
+
+ This does the same as `FT_LCD_FILTER_LEGACY'.
+
+ See
+
+ https://bugs.freedesktop.org/show_bug.cgi?id=92981
+
+ for the reasoning.
+
+ * include/freetype/ftlcdfil.h (FT_LcdFilter): New value
+ `FT_LCD_FILTER_LEGACY1'.
+
+ * src/base/ftlcdfil.c (FT_Library_SetLcdFilter): Use it.
+
2015-11-15 Werner Lemberg <wl@gnu.org>
* src/autofit/afhints.c (af_get_segment_index): Fix it.
diff --git a/include/freetype/ftlcdfil.h b/include/freetype/ftlcdfil.h
index 9e3b425..3a62528 100644
--- a/include/freetype/ftlcdfil.h
+++ b/include/freetype/ftlcdfil.h
@@ -126,14 +126,23 @@ FT_BEGIN_HEADER
* This filter is only provided for comparison purposes, and might be
* disabled or stay unsupported in the future.
*
+ * FT_LCD_FILTER_LEGACY1 ::
+ * For historical reasons, the FontConfig library returns a different
+ * enumeration value for legacy LCD filtering. To make code work that
+ * (incorrectly) forwards FontConfig's enumeration value to
+ * @FT_Library_SetLcdFilter without proper mapping, it is thus easiest
+ * to have another enumeration value, which is completely equal to
+ * `FT_LCD_FILTER_LEGACY'.
+ *
* @since:
- * 2.3.0
+ * 2.3.0 (`FT_LCD_FILTER_LEGACY1' since 2.6.2)
*/
typedef enum FT_LcdFilter_
{
FT_LCD_FILTER_NONE = 0,
FT_LCD_FILTER_DEFAULT = 1,
FT_LCD_FILTER_LIGHT = 2,
+ FT_LCD_FILTER_LEGACY1 = 3,
FT_LCD_FILTER_LEGACY = 16,
FT_LCD_FILTER_MAX /* do not remove */
diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c
index ff6f7e9..b50383c 100644
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -354,6 +354,7 @@
#ifdef USE_LEGACY
case FT_LCD_FILTER_LEGACY:
+ case FT_LCD_FILTER_LEGACY1:
library->lcd_filter_func = _ft_lcd_filter_legacy;
library->lcd_extra = 0;
break;