FT_Init_FreeType( FT_Library *alibrary ) { FT_Error error; FT_Memory memory; /* First of all, allocate a new system object -- this function is part */ /* of the system-specific component, i.e. `ftsystem.c'. */ memory = FT_New_Memory(); if ( !memory ) { FT_ERROR(( "FT_Init_FreeType: cannot find memory manager\n" )); return FT_Err_Unimplemented_Feature; } /* build a library out of it, then fill it with the set of */ /* default drivers. */ error = FT_New_Library( memory, alibrary ); if ( !error ) { (*alibrary)->version_major = FREETYPE_MAJOR; (*alibrary)->version_minor = FREETYPE_MINOR; (*alibrary)->version_patch = FREETYPE_PATCH; FT_Add_Default_Modules( *alibrary ); } return error; }
FT_Init_FreeType( FT_Library *alibrary ) { FT_Error error; FT_Memory memory; /* First of all, allocate a new system object -- this function is part */ /* of the system-specific component, i.e. `ftsystem.c'. */ memory = FT_New_Memory(); if ( !memory ) { FT_ERROR(( "FT_Init_FreeType: cannot find memory manager\n" )); return FT_THROW( Unimplemented_Feature ); } /* build a library out of it, then fill it with the set of */ /* default drivers. */ error = FT_New_Library( memory, alibrary ); if ( error ) FT_Done_Memory( memory ); else FT_Add_Default_Modules( *alibrary ); return error; }