* src/autohint/ahglyph.h, src/autohint/ahglyph.c, src/autohint/ahglobal.c, src/autohint/ahhint.c: fixed blue-scale problem * src/cache/ftccache.c: fixed small bug that could crash the cache in rare circumstances (mostly with broken fonts)
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
diff --git a/ChangeLog b/ChangeLog
index f2e130b..04a45d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,26 @@
* docs/*: serious rewriting of the documentation
+ * include/freetype/internal/ftobjs.h, src/base/ftobjs.c, src/bdf/bdfdrivr.c,
+ src/pcf/pcfdriver.c, src/pfr/pfrsbit.c, src/sfnt/ttsbit.c,
+ src/type42/t42objs.c, src/winfonts/winfnt.c: introduced three new functions
+ to deal with glyph bitmaps within FT_GlyphSlot objects. these are:
+
+ ft_glyphslot_free_bitmap
+ ft_glyphslot_alloc_bitmap
+ ft_glyphslot_set_bitmap
+
+ these are much more convenient to use than managing the FT_GLYPH_OWN_BITMAP
+ flag manually. the font drivers have been modified to use them as well.
+
+ * src/cache/ftlru.c: fixed an invalid assertion check
+
+ * src/autohint/ahglyph.h, src/autohint/ahglyph.c, src/autohint/ahglobal.c,
+ src/autohint/ahhint.c: fixed blue-scale problem
+
+ * src/cache/ftccache.c: fixed small bug that could crash the cache
+ in rare circumstances (mostly with broken fonts)
+
2003-03-15 David Turner <david@freetype.org>
diff --git a/src/autohint/ahglobal.c b/src/autohint/ahglobal.c
index b8fb48a..efce344 100644
--- a/src/autohint/ahglobal.c
+++ b/src/autohint/ahglobal.c
@@ -323,7 +323,7 @@
if ( error )
goto Exit;
- error = ah_outline_load( hinter->glyph, hinter->face );
+ error = ah_outline_load( hinter->glyph, 0x10000L, 0x10000L, hinter->face );
if ( error )
goto Exit;
diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c
index d4fcd4b..4f37504 100644
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -389,6 +389,8 @@
/* */
FT_LOCAL_DEF( FT_Error )
ah_outline_load( AH_Outline outline,
+ FT_Fixed x_scale,
+ FT_Fixed y_scale,
FT_Face face )
{
FT_Memory memory = outline->memory;
@@ -461,8 +463,8 @@
outline->horz_major_dir = AH_DIR_RIGHT;
}
- outline->x_scale = face->size->metrics.x_scale;
- outline->y_scale = face->size->metrics.y_scale;
+ outline->x_scale = x_scale;
+ outline->y_scale = y_scale;
points = outline->points;
if ( outline->num_points == 0 )
@@ -478,8 +480,6 @@
/* compute coordinates */
{
FT_Vector* vec = source->points;
- FT_Fixed x_scale = outline->x_scale;
- FT_Fixed y_scale = outline->y_scale;
for ( point = points; point < point_limit; vec++, point++ )
diff --git a/src/autohint/ahglyph.h b/src/autohint/ahglyph.h
index b116ed9..b346cbe 100644
--- a/src/autohint/ahglyph.h
+++ b/src/autohint/ahglyph.h
@@ -58,6 +58,8 @@ FT_BEGIN_HEADER
FT_LOCAL( FT_Error )
ah_outline_load( AH_Outline outline,
+ FT_Fixed x_scale,
+ FT_Fixed y_scale,
FT_Face face );
FT_LOCAL( void )
diff --git a/src/autohint/ahhint.c b/src/autohint/ahhint.c
index ffc86d6..5814e37 100644
--- a/src/autohint/ahhint.c
+++ b/src/autohint/ahhint.c
@@ -1391,7 +1391,7 @@
/* now, load the slot image into the auto-outline, and run the */
/* automatic hinting process */
- error = ah_outline_load( outline, face ); /* XXX: change to slot */
+ error = ah_outline_load( outline, x_scale, y_scale, face );
if ( error )
goto Exit;
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index aba7ca4..a12fedc 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -362,7 +362,7 @@
if ( manager->num_nodes == 0 )
FT_ERROR(( "ftc_node_destroy: invalid cache node count! = %d\n",
manager->num_nodes ));
-#endif
+#endif
}
@@ -407,11 +407,14 @@
FT_EXPORT_DEF( void )
ftc_family_done( FTC_Family family )
{
- FTC_Manager manager = family->cache->manager;
+ if ( family && family->cache )
+ {
+ FTC_Manager manager = family->cache->manager;
- /* remove from manager's family table */
- ftc_family_table_free( &manager->families, family->fam_index );
+ /* remove from manager's family table */
+ ftc_family_table_free( &manager->families, family->fam_index );
+ }
}
@@ -592,7 +595,7 @@
FT_LruList list = cache->families;
FT_LruNode fam, *pfam;
FT_LruNode_CompareFunc compare = list->clazz->node_compare;
-
+
pfam = &list->nodes;
for (;;)
{
@@ -602,18 +605,18 @@
error = FT_LruList_Lookup( list, query, &lru );
if ( error )
goto Fail;
-
+
goto Skip;
}
-
+
if ( compare( fam, query, list->data ) )
break;
-
+
pfam = &fam->next;
}
-
+
FT_ASSERT( fam != NULL );
-
+
/* move to top of list when needed */
if ( fam != list->nodes )
{
@@ -621,9 +624,9 @@
fam->next = list->nodes;
list->nodes = fam;
}
-
+
lru = fam;
-
+
Skip:
;
}
@@ -634,15 +637,15 @@
FT_UFast hash = query->hash;
FTC_Node* bucket;
FT_UInt idx;
-
-
+
+
idx = hash & cache->mask;
if ( idx < cache->p )
idx = hash & ( cache->mask * 2 + 1 );
-
+
bucket = cache->buckets + idx;
-
-
+
+
if ( query->family != family ||
family->fam_index >= manager->families.size )
{
@@ -651,22 +654,22 @@
error = FTC_Err_Invalid_Argument;
goto Exit;
}
-
+
if ( *bucket )
{
FTC_Node* pnode = bucket;
FTC_Node_CompareFunc compare = cache->clazz->node_compare;
-
+
for ( ;; )
{
FTC_Node node;
-
-
+
+
node = *pnode;
if ( node == NULL )
break;
-
+
if ( node->hash == hash &&
(FT_UInt)node->fam_index == family->fam_index &&
compare( node, query, cache ) )
@@ -678,40 +681,40 @@
node->link = *bucket;
*bucket = node;
}
-
+
/* move to head of MRU list */
if ( node != manager->nodes_list )
ftc_node_mru_up( node, manager );
-
+
*anode = node;
goto Exit;
}
-
+
pnode = &node->link;
}
}
-
+
/* didn't find a node, create a new one */
{
FTC_Cache_Class clazz = cache->clazz;
FT_Memory memory = cache->memory;
FTC_Node node;
-
-
+
+
if ( FT_ALLOC( node, clazz->node_size ) )
goto Fail;
-
+
node->fam_index = (FT_UShort) family->fam_index;
node->hash = query->hash;
node->ref_count = 0;
-
+
error = clazz->node_init( node, query, cache );
if ( error )
{
FT_FREE( node );
goto Fail;
}
-
+
error = ftc_node_hash_link( node, cache );
if ( error )
{
@@ -719,11 +722,11 @@
FT_FREE( node );
goto Fail;
}
-
+
ftc_node_mru_link( node, cache->manager );
-
+
cache->manager->cur_weight += clazz->node_weight( node, cache );
-
+
/* now try to compress the node pool when necessary */
if ( manager->cur_weight >= manager->max_weight )
{
@@ -731,19 +734,19 @@
FTC_Manager_Compress( manager );
node->ref_count--;
}
-
+
*anode = node;
}
-
+
/* all is well, exit now
*/
goto Exit;
}
-
+
Fail:
if ( error != FT_Err_Out_Of_Memory )
goto Exit;
-
+
/* there is not enough memory, try to release some unused nodes
* from the cache to make room for a new one.
*/
@@ -757,7 +760,7 @@
goto Exit;
free_count = new_count;
-
+
/* try to remove "new_count" nodes from the list */
{
FTC_Node first = manager->nodes_list;
@@ -781,7 +784,7 @@
/* if there are no unused nodes in the list, we'd better exit */
if ( new_count == free_count )
goto Exit;
-
+
break;
}