* include/freetype/freetype.h: Document FT_LOAD_TARGET_XXX properly. * src/base/ftglyph.c (ft_bitmap_glyph_class, ft_outline_glyph_class): Tag with FT_CALLBACK_TABLE_DEF. * src/smooth/ftsmooth.c (ft_smooth_render): Handle FT_RENDER_MODE_LIGHT.
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
diff --git a/ChangeLog b/ChangeLog
index 3ece1c7..b88d486 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-02-18 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/freetype.h: Document FT_LOAD_TARGET_XXX properly.
+
+ * src/base/ftglyph.c (ft_bitmap_glyph_class,
+ ft_outline_glyph_class): Tag with FT_CALLBACK_TABLE_DEF.
+
+ * src/smooth/ftsmooth.c (ft_smooth_render): Handle
+ FT_RENDER_MODE_LIGHT.
+
2004-02-17 Werner Lemberg <wl@gnu.org>
Fix callback functions in cache module.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index ff7d987..02195b2 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -4,7 +4,7 @@
/* */
/* FreeType high-level API and common types (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -2254,6 +2254,21 @@ FT_BEGIN_HEADER
* outlines. This doesn't prevent native format-specific hinters from
* being used. This can be important for certain fonts where unhinted
* output is better than auto-hinted one.
+ *
+ * FT_LOAD_TARGET_NORMAL ::
+ * Use hinting for @FT_RENDER_MODE_NORMAL.
+ *
+ * FT_LOAD_TARGET_LIGHT ::
+ * Use hinting for @FT_RENDER_MODE_LIGHT.
+ *
+ * FT_LOAD_TARGET_MONO ::
+ * Use hinting for @FT_RENDER_MODE_MONO.
+ *
+ * FT_LOAD_TARGET_LCD ::
+ * Use hinting for @FT_RENDER_MODE_LCD.
+ *
+ * FT_LOAD_TARGET_LCD_V ::
+ * Use hinting for @FT_RENDER_MODE_LCD_V.
*/
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1
@@ -2276,36 +2291,9 @@ FT_BEGIN_HEADER
/* */
-
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
-
- /***************************************************************************
- *
- * @enum:
- * FT_LOAD_TARGET_XXX
- *
- * @description:
- * A list of load targets. XXX
- *
- * @values:
- * FT_LOAD_TARGET_NORMAL ::
- * XXX
- *
- * FT_LOAD_TARGET_LIGHT ::
- * XXX
- *
- * FT_LOAD_TARGET_MONO ::
- * XXX
- *
- * FT_LOAD_TARGET_LCD ::
- * XXX
- *
- * FT_LOAD_TARGET_LCD_V ::
- * XXX
- */
-
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
#define FT_LOAD_TARGET_MONO FT_LOAD_TARGET_( FT_RENDER_MODE_MONO )
@@ -2367,11 +2355,14 @@ FT_BEGIN_HEADER
/* anti-aliased bitmaps, using 256 levels of opacity. */
/* */
/* FT_RENDER_MODE_LIGHT :: */
- /* This is similar to @FT_RENDER_MODE_NORMAL, except that this */
- /* changes the hinting to prevent stem width quantization. This */
- /* results in glyph shapes that are more similar to the original, */
- /* while being a bit more fuzzy ("better shapes", instead of */
- /* "better contrast" if you want :-). */
+ /* This is similar to @FT_RENDER_MODE_NORMAL -- you have to use */
+ /* @FT_LOAD_TARGET_LIGHT in calls to @FT_Load_Glyph to get any */
+ /* effect since the rendering process no longer influences the */
+ /* positioning of glyph outlines. */
+ /* */
+ /* The resulting glyph shapes are more similar to the original, */
+ /* while being a bit more fuzzy (`better shapes' instead of `better */
+ /* contrast', so to say. */
/* */
/* FT_RENDER_MODE_MONO :: */
/* This mode corresponds to 1-bit bitmaps. */
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index e6311b5..c6c458c 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -206,6 +206,7 @@
}
+ FT_CALLBACK_TABLE_DEF
const FT_Glyph_Class ft_bitmap_glyph_class =
{
sizeof( FT_BitmapGlyphRec ),
@@ -324,6 +325,7 @@
}
+ FT_CALLBACK_TABLE_DEF
const FT_Glyph_Class ft_outline_glyph_class =
{
sizeof( FT_OutlineGlyphRec ),
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 9aee312..f8d6110 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -2331,7 +2331,7 @@
glyph_index = cff->charset.cids[glyph_index];
cff_decoder_init( &decoder, face, size, glyph, hinting,
- FT_LOAD_TARGET_MODE(load_flags) );
+ FT_LOAD_TARGET_MODE( load_flags ) );
decoder.builder.no_recurse =
(FT_Bool)( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 );
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 4c21097..3717eeb 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -306,7 +306,7 @@
0, /* glyph names -- XXX */
0, /* blend == 0 */
hinting,
- FT_LOAD_TARGET_MODE(load_flags),
+ FT_LOAD_TARGET_MODE( load_flags ),
cid_load_glyph );
/* set up the decoder */
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 40d5f50..af8783e 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2001, 2002, 2003 by */
+/* Copyright 2000-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -236,6 +236,9 @@
FT_Render_Mode mode,
FT_Vector* origin )
{
+ if ( mode == FT_RENDER_MODE_LIGHT )
+ mode = FT_RENDER_MODE_NORMAL;
+
return ft_smooth_render_generic( render, slot, mode, origin,
FT_RENDER_MODE_NORMAL,
0, 0 );
diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c
index c8d1db7..98f8194 100644
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -255,7 +255,7 @@
(FT_Byte**)type1->glyph_names,
face->blend,
FT_BOOL( hinting ),
- FT_LOAD_TARGET_MODE(load_flags),
+ FT_LOAD_TARGET_MODE( load_flags ),
T1_Parse_Glyph );
if ( error )
goto Exit;