348 |
FT_GlyphSlot slot; |
FT_GlyphSlot slot; |
349 |
|
|
350 |
|
|
351 |
if ( !face || !aslot || !face->driver ) |
if ( !face || !face->driver ) |
352 |
return FT_Err_Invalid_Argument; |
return FT_Err_Invalid_Argument; |
353 |
|
|
|
*aslot = 0; |
|
|
|
|
354 |
driver = face->driver; |
driver = face->driver; |
355 |
clazz = driver->clazz; |
clazz = driver->clazz; |
356 |
memory = driver->root.memory; |
memory = driver->root.memory; |
368 |
goto Exit; |
goto Exit; |
369 |
} |
} |
370 |
|
|
371 |
*aslot = slot; |
slot->next = face->glyph; |
372 |
|
face->glyph = slot; |
373 |
|
|
374 |
|
if ( aslot ) |
375 |
|
*aslot = slot; |
376 |
} |
} |
377 |
|
else if ( aslot ) |
378 |
|
*aslot = 0; |
379 |
|
|
380 |
|
|
381 |
Exit: |
Exit: |
382 |
FT_TRACE4(( "FT_New_GlyphSlot: Return %d\n", error )); |
FT_TRACE4(( "FT_New_GlyphSlot: Return %d\n", error )); |
391 |
{ |
{ |
392 |
if ( slot ) |
if ( slot ) |
393 |
{ |
{ |
394 |
FT_Driver driver = slot->face->driver; |
FT_Driver driver = slot->face->driver; |
395 |
FT_Memory memory = driver->root.memory; |
FT_Memory memory = driver->root.memory; |
396 |
FT_GlyphSlot* parent; |
FT_GlyphSlot prev; |
397 |
FT_GlyphSlot cur; |
FT_GlyphSlot cur; |
398 |
|
|
399 |
|
|
400 |
/* Remove slot from its parent face's list */ |
/* Remove slot from its parent face's list */ |
401 |
parent = &slot->face->glyph; |
prev = NULL; |
402 |
cur = *parent; |
cur = slot->face->glyph; |
403 |
|
|
404 |
while ( cur ) |
while ( cur ) |
405 |
{ |
{ |
406 |
if ( cur == slot ) |
if ( cur == slot ) |
407 |
{ |
{ |
408 |
*parent = cur->next; |
if ( !prev ) |
409 |
|
slot->face->glyph = cur->next; |
410 |
|
else |
411 |
|
prev->next = cur->next; |
412 |
|
|
413 |
ft_glyphslot_done( slot ); |
ft_glyphslot_done( slot ); |
414 |
FT_FREE( slot ); |
FT_FREE( slot ); |
415 |
break; |
break; |
416 |
} |
} |
417 |
cur = cur->next; |
prev = cur; |
418 |
|
cur = cur->next; |
419 |
} |
} |
420 |
} |
} |
421 |
} |
} |
1687 |
FT_List_Add( &face->driver->faces_list, node ); |
FT_List_Add( &face->driver->faces_list, node ); |
1688 |
|
|
1689 |
/* now allocate a glyph slot object for the face */ |
/* now allocate a glyph slot object for the face */ |
1690 |
{ |
FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" )); |
|
FT_GlyphSlot slot; |
|
|
|
|
1691 |
|
|
1692 |
FT_TRACE4(( "FT_Open_Face: Creating glyph slot\n" )); |
error = FT_New_GlyphSlot( face, NULL ); |
1693 |
|
if ( error ) |
1694 |
error = FT_New_GlyphSlot( face, &slot ); |
goto Fail; |
|
if ( error ) |
|
|
goto Fail; |
|
|
|
|
|
face->glyph = slot; |
|
|
} |
|
1695 |
|
|
1696 |
/* finally, allocate a size object for the face */ |
/* finally, allocate a size object for the face */ |
1697 |
{ |
{ |