本文整理汇总了C++中FT_MEM_SET函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_MEM_SET函数的具体用法?C++ FT_MEM_SET怎么用?C++ FT_MEM_SET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FT_MEM_SET函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tt_driver_class_pic_init
FT_Error
tt_driver_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
TTModulePIC* container = NULL;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->truetype = container;
/* initialize pointer table - this is how the module usually */
/* expects this data */
error = FT_Create_Class_tt_services( library,
&container->tt_services );
if ( error )
goto Exit;
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
FT_Init_Class_tt_service_gx_multi_masters(
&container->tt_service_gx_multi_masters );
#endif
FT_Init_Class_tt_service_truetype_glyf(
&container->tt_service_truetype_glyf );
Exit:
if ( error )
tt_driver_class_pic_free( library );
return error;
}
示例2: cff_driver_class_pic_init
FT_Error
cff_driver_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
CffModulePIC* container;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof(*container) );
pic_container->cff = container;
/* initialize pointer table - this is how the module usually expects this data */
error = FT_Create_Class_cff_services(library, &container->cff_services);
if(error)
goto Exit;
error = FT_Create_Class_cff_field_handlers(library, &container->cff_field_handlers);
if(error)
goto Exit;
FT_Init_Class_cff_service_ps_info(library, &container->cff_service_ps_info);
FT_Init_Class_cff_service_glyph_dict(library, &container->cff_service_glyph_dict);
FT_Init_Class_cff_service_ps_name(library, &container->cff_service_ps_name);
FT_Init_Class_cff_service_get_cmap_info(library, &container->cff_service_get_cmap_info);
FT_Init_Class_cff_service_cid_info(library, &container->cff_service_cid_info);
FT_Init_Class_cff_cmap_encoding_class_rec(library, &container->cff_cmap_encoding_class_rec);
FT_Init_Class_cff_cmap_unicode_class_rec(library, &container->cff_cmap_unicode_class_rec);
Exit:
if(error)
cff_driver_class_pic_free(library);
return error;
}
示例3: ft_raster1_renderer_class_pic_init
FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
RasterPIC* container = NULL;
FT_Memory memory = library->memory;
/* XXX: since this function also served the no longer available */
/* raster5 renderer it uses reference counting, which could */
/* be removed now */
if ( pic_container->raster )
{
((RasterPIC*)pic_container->raster)->ref_count++;
return error;
}
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->raster = container;
container->ref_count = 1;
/* initialize pointer table - */
/* this is how the module usually expects this data */
FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );
return error;
}
示例4: ft_smooth_renderer_class_pic_init
FT_Error
ft_smooth_renderer_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
SmoothPIC* container = NULL;
FT_Memory memory = library->memory;
/* since this function also serve smooth_lcd and smooth_lcdv renderers,
it implements reference counting */
if ( pic_container->smooth )
{
((SmoothPIC*)pic_container->smooth)->ref_count++;
return error;
}
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->smooth = container;
container->ref_count = 1;
/* initialize pointer table - */
/* this is how the module usually expects this data */
FT_Init_Class_ft_grays_raster( &container->ft_grays_raster );
return error;
}
示例5: psnames_module_class_pic_init
FT_Error
psnames_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = PSnames_Err_Ok;
PSModulePIC* container;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof(*container) );
pic_container->psnames = container;
/* initialize pointer table - this is how the module usually expects this data */
error = FT_Create_Class_pscmaps_services(library, &container->pscmaps_services);
if(error)
goto Exit;
FT_Init_Class_pscmaps_interface(library, &container->pscmaps_interface);
Exit:
if(error)
psnames_module_class_pic_free(library);
return error;
}
示例6: FT_Alloc
FT_Alloc( FT_Memory memory,
FT_Long size,
void* *P )
{
FT_ASSERT( P != 0 );
if ( size > 0 )
{
*P = memory->alloc( memory, size );
if ( !*P )
{
FT_ERROR(( "FT_Alloc:" ));
FT_ERROR(( " Out of memory? (%ld requested)\n",
size ));
return FT_Err_Out_Of_Memory;
}
FT_MEM_SET( *P, 0, size );
}
else
*P = NULL;
FT_TRACE7(( "FT_Alloc:" ));
FT_TRACE7(( " size = %ld, block = 0x%08p, ref = 0x%08p\n",
size, *P, P ));
return FT_Err_Ok;
}
示例7: sfnt_module_class_pic_init
FT_Error
sfnt_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
sfntModulePIC* container;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof(*container) );
pic_container->sfnt = container;
/* initialize pointer table - this is how the module usually expects this data */
error = FT_Create_Class_sfnt_services(library, &container->sfnt_services);
if(error)
goto Exit;
error = FT_Create_Class_tt_cmap_classes(library, &container->tt_cmap_classes);
if(error)
goto Exit;
FT_Init_Class_sfnt_service_glyph_dict(library, &container->sfnt_service_glyph_dict);
FT_Init_Class_sfnt_service_ps_name(library, &container->sfnt_service_ps_name);
FT_Init_Class_tt_service_get_cmap_info(library, &container->tt_service_get_cmap_info);
FT_Init_Class_sfnt_service_sfnt_table(&container->sfnt_service_sfnt_table);
#ifdef TT_CONFIG_OPTION_BDF
FT_Init_Class_sfnt_service_bdf(&container->sfnt_service_bdf);
#endif
FT_Init_Class_sfnt_interface(library, &container->sfnt_interface);
Exit:
if(error)
sfnt_module_class_pic_free(library);
return error;
}
示例8: ft_raster1_renderer_class_pic_init
FT_Error
ft_raster1_renderer_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = Raster_Err_Ok;
RasterPIC* container;
FT_Memory memory = library->memory;
/* since this function also serve raster5 renderer,
it implements reference counting */
if ( pic_container->raster )
{
((RasterPIC*)pic_container->raster)->ref_count++;
return error;
}
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->raster = container;
container->ref_count = 1;
/* initialize pointer table - this is how the module usually expects this data */
FT_Init_Class_ft_standard_raster( &container->ft_standard_raster );
/*Exit:*/
if( error )
ft_raster1_renderer_class_pic_free( library );
return error;
}
示例9: ft_smooth_get_cbox
/* return the glyph's control box */
static void
ft_smooth_get_cbox( FT_Renderer render,
FT_GlyphSlot slot,
FT_BBox* cbox )
{
FT_MEM_SET( cbox, 0, sizeof ( *cbox ) );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
}
示例10: ft_pic_container_init
ft_pic_container_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
FT_MEM_SET( pic_container, 0, sizeof ( *pic_container ) );
error = ft_base_pic_init( library );
if ( error )
return error;
return FT_Err_Ok;
}
示例11: ft_mem_table_new
static FT_MemTable
ft_mem_table_new( FT_Memory memory )
{
FT_MemTable table;
table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
if ( table == NULL )
goto Exit;
FT_MEM_SET( table, 0, sizeof ( *table ) );
table->size = FT_MEM_SIZE_MIN;
table->nodes = 0;
table->memory = memory;
table->memory_user = memory->user;
table->alloc = memory->alloc;
table->realloc = memory->realloc;
table->free = memory->free;
table->buckets = (FT_MemNode *)
memory->alloc( memory,
table->size * sizeof ( FT_MemNode ) );
if ( table->buckets )
FT_MEM_SET( table->buckets, 0, sizeof ( FT_MemNode ) * table->size );
else
{
memory->free( memory, table );
table = NULL;
}
Exit:
return table;
}
示例12: autofit_module_class_pic_init
FT_Error
autofit_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_UInt ss;
FT_Error error = AF_Err_Ok;
AFModulePIC* container;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof ( *container ) );
pic_container->autofit = container;
/* initialize pointer table - */
/* this is how the module usually expects this data */
for ( ss = 0 ; ss < AF_SCRIPT_CLASSES_REC_COUNT ; ss++ )
{
container->af_script_classes[ss] =
&container->af_script_classes_rec[ss];
}
container->af_script_classes[AF_SCRIPT_CLASSES_COUNT - 1] = NULL;
/* add call to initialization function when you add new scripts */
ss = 0;
FT_Init_Class_af_dummy_script_class(
&container->af_script_classes_rec[ss++] );
#ifdef FT_OPTION_AUTOFIT2
FT_Init_Class_af_latin2_script_class(
&container->af_script_classes_rec[ss++] );
#endif
FT_Init_Class_af_latin_script_class(
&container->af_script_classes_rec[ss++] );
FT_Init_Class_af_cjk_script_class(
&container->af_script_classes_rec[ss++] );
FT_Init_Class_af_indic_script_class(
&container->af_script_classes_rec[ss++] );
FT_Init_Class_af_autofitter_service(
library, &container->af_autofitter_service );
/* Exit: */
if ( error )
autofit_module_class_pic_free( library );
return error;
}
示例13: ft_mem_table_resize
static void
ft_mem_table_resize( FT_MemTable table )
{
FT_ULong new_size;
new_size = ft_mem_closest_prime( table->nodes );
if ( new_size != table->size )
{
FT_MemNode* new_buckets ;
FT_ULong i;
new_buckets = (FT_MemNode *)
ft_mem_table_alloc( table,
new_size * sizeof ( FT_MemNode ) );
if ( new_buckets == NULL )
return;
FT_MEM_SET( new_buckets, 0, sizeof ( FT_MemNode ) * new_size );
for ( i = 0; i < table->size; i++ )
{
FT_MemNode node, next, *pnode;
FT_ULong hash;
node = table->buckets[i];
while ( node )
{
next = node->link;
hash = FT_MEM_VAL( node->address ) % new_size;
pnode = new_buckets + hash;
node->link = pnode[0];
pnode[0] = node;
node = next;
}
}
if ( table->buckets )
ft_mem_table_free( table, table->buckets );
table->buckets = new_buckets;
table->size = new_size;
}
}
示例14: pshinter_module_class_pic_init
FT_Error
pshinter_module_class_pic_init( FT_Library library )
{
FT_PIC_Container* pic_container = &library->pic_container;
FT_Error error = FT_Err_Ok;
PSHinterPIC* container;
FT_Memory memory = library->memory;
/* allocate pointer, clear and set global container pointer */
if ( FT_ALLOC ( container, sizeof ( *container ) ) )
return error;
FT_MEM_SET( container, 0, sizeof(*container) );
pic_container->pshinter = container;
/* add call to initialization function when you add new scripts */
FT_Init_Class_pshinter_interface(library, &container->pshinter_interface);
/*Exit:*/
if(error)
pshinter_module_class_pic_free(library);
return error;
}
示例15: T1_Decoder_Init
T1_Decoder_Init( T1_Decoder decoder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
FT_Byte** glyph_names,
PS_Blend blend,
FT_Bool hinting,
T1_Decoder_Callback parse_callback )
{
FT_MEM_SET( decoder, 0, sizeof ( *decoder ) );
/* retrieve PSNames interface from list of current modules */
{
PSNames_Service psnames = 0;
psnames = (PSNames_Service)FT_Get_Module_Interface(
FT_FACE_LIBRARY(face), "psnames" );
if ( !psnames )
{
FT_ERROR(( "T1_Decoder_Init: " ));
FT_ERROR(( "the `psnames' module is not available\n" ));
return PSaux_Err_Unimplemented_Feature;
}
decoder->psnames = psnames;
}
T1_Builder_Init( &decoder->builder, face, size, slot, hinting );
decoder->num_glyphs = face->num_glyphs;
decoder->glyph_names = glyph_names;
decoder->blend = blend;
decoder->parse_callback = parse_callback;
decoder->funcs = t1_decoder_funcs;
return 0;
}