* Jamfile, docs/reference/README: fix it so that "jam refdoc" works correctly to generate the API reference in 'docs/reference' * src/tools/docmaker/tohtml.py: update to output nicer fields lists in the API reference * src/base/ftobjs.c (FT_Load_Glyph): FT_LOAD_TARGET_LIGHT now forces auto-hinting * freetype/freetype.h: updating the documentation for FT_LOAD_TARGET_XXX and FT_Render_Mode values
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 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
diff --git a/ChangeLog b/ChangeLog
index c60cae8..7538bde 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2005-12-23 David Turner <david@freetype.org>
+
+ * Jamfile, docs/reference/README: fix it so that "jam refdoc" works
+ correctly to generate the API reference in 'docs/reference'
+
+ * src/tools/docmaker/tohtml.py: update to output nicer fields lists
+ in the API reference
+
+ * src/base/ftobjs.c (FT_Load_Glyph): FT_LOAD_TARGET_LIGHT now
+ forces auto-hinting
+
+ * freetype/freetype.h: updating the documentation for
+ FT_LOAD_TARGET_XXX and FT_Render_Mode values
+
+
2005-12-23 suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
* src/base/ftmac.c (FT_New_Face_From_Suitcase): Counts scalable
diff --git a/Jamfile b/Jamfile
index b3e9d24..9075abe 100644
--- a/Jamfile
+++ b/Jamfile
@@ -181,6 +181,13 @@ if $(DEBUG_HINTER)
SubInclude FT2_TOP tests ;
}
+rule RefDoc
+{
+ Depends $1 : all ;
+ NotFile $1 ;
+ Always $1 ;
+}
+
actions RefDoc
{
python $(FT2_SRC)/tools/docmaker/docmaker.py --prefix=ft2 --title=FreeType-2.1.10 --output=$(DOC_DIR) $(FT2_INCLUDE)/freetype/*.h $(FT2_INCLUDE)/freetype/config/*.h $(FT2_INCLUDE)/freetype/cache/*.h
diff --git a/docs/CHANGES b/docs/CHANGES
index 382c6b5..f1231c3 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -14,6 +14,10 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
II. IMPORTANT CHANGES
+ - the LIGHT hinting algorithm produces more pleasant results. Also,
+ using the FT_LOAD_TARGET_LIGHT flags within FT_Load_Glyph will always
+ force auto-hinting, as a special exception.
+
- Face metrics (face->size->metrics) and glyph metrics are no
longer rounded. If you do not round in your applications too,
you may find glyphs become blurry.
@@ -43,6 +47,11 @@ LATEST CHANGES BETWEEN 2.2.0 and 2.1.10
III. MISCELLANEOUS
+ - the documentation for FT_LOAD_TARGET_XXX and FT_RENDER_MODE_XXX
+ values have been updated to better reflect their uses and differences
+ (one set is used to specify hinting algorithm, the other to specify
+ pixel rendering mode).
+
- FT_New_Face() & FT_New_Face_From_FSSpec() in ftmac.c are changed
to count supported scalable faces (sfnt, LWFN) only, and returns
the number of available faces via face->num_faces. Unsupported
@@ -96,15 +105,15 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
highly recommended to upgrade.
- FreeType didn't properly parse empty Type 1 glyphs.
-
+
- An unbound dynamic buffer growth was fixed in the PFR loader.
-
+
- Several bugs have been fixed in the cache sub-system.
- FreeType behaved incorrectly when resizing two distinct but very
close character pixel sizes through `FT_Set_Char_Size' (Savannah
bug #12263).
-
+
- The auto-hinter didn't work properly for fonts without a Unicode
charmap -- it even refused to load the glyphs.
@@ -184,7 +193,7 @@ LATEST CHANGES BETWEEN 2.1.10 and 2.1.9
PIC mode (i.e., when generating a Unix shared object/dll) put
the array into the non-shared writable section of the library
since absolute pointers are not relocatable by nature.
-
+
This reduces the memory consumption by approximately 16KByte per
process linked to FreeType. We now also store the array in a
compressed form (as a trie) which saves about 20KByte of code as
diff --git a/docs/reference/README b/docs/reference/README
index 7c3467b..35efe70 100644
--- a/docs/reference/README
+++ b/docs/reference/README
@@ -1,2 +1,5 @@
After saying `make refdoc' this directory contains the FreeType API
reference. You need python to make this target.
+
+This also works with Jam, just type 'jam refdoc' in the main directory.
+
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index affd521..e7c953a 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2356,7 +2356,7 @@ FT_BEGIN_HEADER
* FT_LOAD_IGNORE_TRANSFORM ::
* Indicates that the glyph loader should not try to transform the
* loaded glyph image. This doesn't prevent scaling, hinting, or
- * rendering.
+ * rendering. See @FT_Set_Transform
*
* FT_LOAD_MONOCHROME ::
* This flag is used with @FT_LOAD_RENDER to indicate that you want
@@ -2379,34 +2379,9 @@ FT_BEGIN_HEADER
* See also FT_FACE_FLAG_HINTER (@FT_FACE_FLAG_XXX), FT_LOAD_FORCE_AUTO,
* and FT_LOAD_NO_HINTING above.
*
- * 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.
- *
* @note:
- * You should use only _one_ of the FT_LOAD_TARGET_XXX values; they
- * can't be ORed.
- *
- * However, FreeType makes a distinction between the hinting algorithm
- * being used, and the pixel mode of the target bitmaps. For example,
- * it is possible to use the `light' hinting algorithm and have the
- * results rendered in horizontal LCD pixel mode, with code like this:
- *
- * FT_Load_Glyph( face, glyph_index,
- * load_flags | FT_LOAD_TARGET_LIGHT );
- * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
- *
+ * see also @FT_LOAD_TARGET_XXX which relate to hinting algorithm
+ * selection.
*/
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE 0x1
@@ -2429,8 +2404,72 @@ FT_BEGIN_HEADER
/* */
+ /**************************************************************************
+ *
+ * @enum: FT_LOAD_TARGET_XXX
+ *
+ * @description:
+ * a list of values that are used to select a specific hinting
+ * algorithm to the glyph loader. You should OR one of these values
+ * to your 'load_flags' when calling @FT_Load_Glyph.
+ *
+ * note that these values are only used by the auto-hinter, and ignored
+ * by the native ones (e.g. the TrueType bytecode interpreter). You
+ * must use @FT_LOAD_FORCE_AUTOHINT to ensure that they're always used.
+ *
+ * @FT_LOAD_TARGET_LIGHT being an exception, that always forces the
+ * auto-hinter.
+ *
+ * @values:
+ * FT_LOAD_TARGET_NORMAL ::
+ * correspond to the default hinting algorithm, optimized for standard
+ * gray-level rendering. for monochrome output, use @FT_RENDER_MODE_MONO
+ * instead.
+ *
+ * FT_LOAD_TARGET_LIGHT ::
+ * correspond to a lighter hinting algorithm for non-monochrome modes.
+ * This will generate more glyphs that are more fuzzy but more faithful
+ * to their original shape. A bit like Mac OS X.
+ *
+ * As a special exception, this values *always* forces auto-hinting,
+ * whatever the native hinter is.
+ *
+ * FT_LOAD_TARGET_MONO ::
+ * strong hinting algorithm that should only be used for monochrome
+ * output. The result will probably be unpleasant for other rendering
+ * modes.
+ *
+ * FT_LOAD_TARGET_LCD ::
+ * a variant of @FT_LOAD_TARGET_NORMAL optimized for horizontally
+ * decimated LCD displays.
+ *
+ * FT_LOAD_TARGET_LCD_V ::
+ * a variant of @FT_LOAD_TARGET_NORMAL optimized for vertically decimated
+ * LCD displays.
+ *
+ * @note:
+ * You should use only _one_ of the FT_LOAD_TARGET_XXX values in your
+ * 'load_flags'. They can't be ORed.
+ *
+ * If you also use the @FT_LOAD_RENDER flag, then the output will be
+ * determined by the corresponding @FT_Render_Mode value. E.g.
+ * @FT_LOAD_TARGET_NORMAL will generate a gray-level pixmap
+ * (see @FT_RENDER_MODE_NORMAL)
+ *
+ * You can use a hinting algorithm that doesn't correspond to the same
+ * rendering mode. For example, it is possible to use the `light' hinting
+ * algorithm and have the results rendered in horizontal LCD pixel mode,
+ * with code like this:
+ *
+ * {
+ * FT_Load_Glyph( face, glyph_index,
+ * load_flags | FT_LOAD_TARGET_LIGHT );
+ *
+ * FT_Render_Glyph( face->glyph, FT_RENDER_MODE_LCD );
+ * }
+ */
+
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
-#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
@@ -2438,6 +2477,15 @@ FT_BEGIN_HEADER
#define FT_LOAD_TARGET_LCD FT_LOAD_TARGET_( FT_RENDER_MODE_LCD )
#define FT_LOAD_TARGET_LCD_V FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V )
+/**
+ * @macro: FT_LOAD_TARGET_MODE
+ *
+ * @description:
+ * return the @FT_Render_Mode corresponding to a given @FT_LOAD_TARGET_XXX
+ * value.
+ */
+#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
+
/* */
@@ -2480,8 +2528,7 @@ FT_BEGIN_HEADER
/* <Description> */
/* An enumeration type that lists the render modes supported by */
/* FreeType 2. Each mode corresponds to a specific type of scanline */
- /* conversion performed on the outline, as well as specific */
- /* hinting optimizations. */
+ /* conversion performed on the outline. */
/* */
/* For bitmap fonts the `bitmap->pixel_mode' field in the */
/* @FT_GlyphSlotRec structure gives the format of the returned */
@@ -2493,14 +2540,10 @@ FT_BEGIN_HEADER
/* anti-aliased bitmaps, using 256 levels of opacity. */
/* */
/* FT_RENDER_MODE_LIGHT :: */
- /* 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. */
+ /* This is equivalent to @FT_RENDER_MODE_NORMAL. It is only defined */
+ /* as a separate value because render modes are also used */
+ /* indirectly to define hinting algorithm selectors. See */
+ /* @FT_LOAD_TARGET_XXX for details. */
/* */
/* FT_RENDER_MODE_MONO :: */
/* This mode corresponds to 1-bit bitmaps. */
@@ -2691,7 +2734,8 @@ FT_BEGIN_HEADER
/* */
/* <Description> */
/* Retrieves the ASCII name of a given glyph in a face. This only */
- /* works for those faces where FT_HAS_GLYPH_NAME(face) returns true. */
+ /* works for those faces where @FT_HAS_GLYPH_NAMES(face) returns */
+ /* TRUE. */
/* */
/* <Input> */
/* face :: A handle to a source face object. */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 84436e1..34d35b6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -523,6 +523,11 @@
FT_LOAD_NO_AUTOHINT ) ) &&
FT_DRIVER_IS_SCALABLE( driver ) &&
FT_DRIVER_USES_OUTLINES( driver ) );
+
+ /* force auto-hinting for the LIGHT hinting mode */
+ if ( autohint && FT_LOAD_TARGET_MODE(load_flags) == FT_RENDER_MODE_LIGHT )
+ load_flags |= FT_LOAD_FORCE_AUTOHINT;
+
if ( autohint )
{
if ( FT_DRIVER_HAS_HINTER( driver ) &&
diff --git a/src/tools/docmaker/tohtml.py b/src/tools/docmaker/tohtml.py
index 2b9c547..355133f 100644
--- a/src/tools/docmaker/tohtml.py
+++ b/src/tools/docmaker/tohtml.py
@@ -192,6 +192,7 @@ class HtmlFormatter(Formatter):
url = self.make_block_url( block )
return '<a href="' + url + '">' + name + '</a>' + rest
except:
+ # we detected a cross-reference to an unknown item
return '?' + name + '?' + rest
# look for italics and bolds
@@ -246,7 +247,7 @@ class HtmlFormatter(Formatter):
def print_html_field( self, field ):
if field.name:
- print "<table><tr valign=top><td><b>"+field.name+"</b></td><td>"
+ print "<table><tr valign=top><td><p><b>"+field.name+"</b></p></td><td>"
print self.make_html_items( field.items )
@@ -288,9 +289,14 @@ class HtmlFormatter(Formatter):
def print_html_field_list( self, fields ):
- print "<table cellpadding=3>"
+ print "<table cellpadding=3 border=0>"
for field in fields:
- print "<tr valign=top><td><b>" + field.name + "</b></td><td>"
+ if len(field.name) > 22:
+ print "<tr valign=top><td colspan=0><b>"+field.name+"</b></td></tr>"
+ print "<tr valign=top><td></td><td>"
+ else:
+ print "<tr valign=top><td><b>" + field.name + "</b></td><td>"
+
self.print_html_items( field.items )
print "</td></tr>"
print "</table>"
@@ -488,4 +494,4 @@ class HtmlFormatter(Formatter):
def section_dump_all( self ):
for section in self.sections:
self.section_dump( section, self.file_prefix + section.name + '.html' )
-
+