updated the CHANGES file, plus a few fix in "ftstring" to display monochrome glyphs too
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
diff --git a/CHANGES b/CHANGES
index 9bb65c3..e3f1720 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,43 @@
LATEST CHANGES
+ - CHANGES TO THE HIGH-LEVEL API
+
+ o FT_Get_Kerning has a new parameter that allows you to select
+ the coordinates of the kerning vector ( font units, scaled,
+ scaled + grid-fitted ).
+
+ o the outline functions are now in <freetype/ftoutln.h> and not
+ part of <freetype/freetype.h> anymore
+
+ o <freetype/ftmodule.h> now contains declarations for
+ FT_New_Library, FT_Done_Library, FT_Add_Default_Modules
+
+ o the so-called convenience functions have moved from "ftoutln.c"
+ to "ftglyph.c", and are thus available with this optional component
+ of the library. They are declared in <freetype/ftglyph.h> now..
+
+ o anti-aliased rendering is now the default for FT_Render_Glyph
+ (i.e. corresponds to render_mode == 0 == ft_render_mode_normal).
+ To generate a monochrome bitmap, use ft_render_mode_mono, or the
+ FT_LOAD_MONOCHROME flag in FT_Load_Glyph/FT_Load_Char.
+
+ FT_LOAD_ANTI_ALIAS is still defined, but values to 0.
+
+ o <freetype/freetype.h> now include <freetype/config/ftconfig.h>,
+ solving a few headaches :-)
+
+ o the type FT_GlyphSlotRec has now a "library" field.
+
+
+
+ - CHANGES TO THE "ftglyph.h" API
+
+ This API has been severely modified in order to make it simpler,
+ clearer, and more efficient. It certainly now looks like a real
+ "glyph factory" object, and allows client applications to manage
+ (i.e. transform, bbox and render) glyph images without ever knowing
+ their original format.
+
- added support for CID-keyed fonts to the CFF driver.
maybe support for pure CFF + CEF fonts should come in ??
@@ -13,6 +51,22 @@ LATEST CHANGES
Also removed the use of "cidafm" for now, even if the source files
are still there. This functionality will certainly go into a specific
module..
+
+
+
+ - ADDED SUPPORT FOR THE AUTO-HINTER
+
+ It works :-) I have a demo program which simply is a copy of "ftview"
+ that does a FT_Add_Module( library, &autohinter_module_class ) after
+ library initialisation, and Type 1 & OpenType/CFF fonts are now hinted.
+
+ CID fonts are not hinted, as they include no charmap and the auto-hinter
+ doesn't include "generic" global metrics computations yet..
+
+ Now, I need to release this thing to the FreeType 2 source..
+
+
+
- CHANGES TO THE RENDERER MODULES
diff --git a/demos/src/ftstring.c b/demos/src/ftstring.c
index 61c7c75..2f434ae 100644
--- a/demos/src/ftstring.c
+++ b/demos/src/ftstring.c
@@ -190,48 +190,6 @@
/**************************************************************
*
- * Compute the dimension of a string of glyphs in pixels
- *
- */
- static void compute_bbox( FT_BBox* abbox )
- {
- PGlyph glyph = glyphs;
- FT_BBox bbox;
- int n;
-
- bbox.xMin = 32000; bbox.xMax = -32000;
- bbox.yMin = 32000; bbox.yMax = -32000;
-
- for ( n = 0; n < num_glyphs; n++, glyph++ )
- {
- FT_BBox cbox;
- FT_Pos x, y;
-
- if (!glyph->image) continue;
-
- x = glyph->pos.x;
- y = glyph->pos.y;
-
- FT_Glyph_Get_CBox( glyph->image,
- ft_glyph_bbox_gridfit,
- &cbox );
-
- cbox.xMin += x;
- cbox.yMin += y;
- cbox.xMax += x;
- cbox.yMax += y;
-
- if (cbox.xMin < bbox.xMin) bbox.xMin = cbox.xMin;
- if (cbox.xMax > bbox.xMax) bbox.xMax = cbox.xMax;
- if (cbox.yMin < bbox.yMin) bbox.yMin = cbox.yMin;
- if (cbox.yMax > bbox.yMax) bbox.yMax = cbox.yMax;
- }
- *abbox = bbox;
- }
-
-
- /**************************************************************
- *
* Layout a string of glyphs, the glyphs are untransformed..
*
*/
@@ -346,7 +304,8 @@
{
/* convert to a bitmap - destroy native image */
error = FT_Glyph_To_Bitmap( &image,
- ft_render_mode_normal,
+ antialias ? ft_render_mode_normal
+ : ft_render_mode_mono,
0, 1 );
if (!error)
{
@@ -586,8 +545,8 @@
static void usage( char* execname )
{
fprintf( stderr, "\n" );
- fprintf( stderr, "ftview: simple string viewer -- part of the FreeType project\n" );
- fprintf( stderr, "------------------------------------------------------------\n" );
+ fprintf( stderr, "ftstring: string viewer -- part of the FreeType project\n" );
+ fprintf( stderr, "-------------------------------------------------------\n" );
fprintf( stderr, "\n" );
fprintf( stderr, "Usage: %s [options below] ppem fontname[.ttf|.ttc] ...\n",
execname );
@@ -679,6 +638,10 @@
strncpy( filename, argv[file], 128 );
strncpy( alt_filename, argv[file], 128 );
+ /* first, try to load the glyph name as-is */
+ error = FT_New_Face( library, filename, 0, &face );
+ if (!error) goto Success;
+
#ifndef macintosh
if ( i >= 0 )
{
@@ -687,11 +650,11 @@
}
#endif
- /* Load face */
-
+ /* if it didn't work, try to add ".ttf" at the end */
error = FT_New_Face( library, filename, 0, &face );
if (error) goto Display_Font;
+ Success:
/* prepare the text to be rendered */
prepare_text( (unsigned char*)Text );
@@ -733,11 +696,8 @@
{
/* layout & render string */
{
- FT_BBox bbox;
-
reset_transform();
layout_glyphs();
- compute_bbox( &bbox );
render_string( bit.width/2, bit.rows/2 );
}
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index bc101ca..ac765d5 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1822,7 +1822,7 @@
/* FT_Render_Glyph. */
/* */
/* */
-#define FT_LOAD_MONOCHROME 0 /* this is the default */
+#define FT_LOAD_MONOCHROME 4096
/*************************************************************************/