您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FT_MEM_SET函数代码示例

51自学网 2021-06-01 20:44:22
  C++
这篇教程C++ FT_MEM_SET函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中FT_MEM_SET函数的典型用法代码示例。如果您正苦于以下问题:C++ FT_MEM_SET函数的具体用法?C++ FT_MEM_SET怎么用?C++ FT_MEM_SET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了FT_MEM_SET函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;  }
开发者ID:1nt3g3r,项目名称:libgdx,代码行数:33,


示例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;  }
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:33,


示例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;  }
开发者ID:erdincay,项目名称:vcxsrv-linux2windows,代码行数:32,


示例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;  }
开发者ID:1nt3g3r,项目名称:libgdx,代码行数:31,


示例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;  }
开发者ID:0309,项目名称:cocos2d-x,代码行数:26,


示例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;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:28,


示例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;  }
开发者ID:GaZ3ll3,项目名称:enable,代码行数:35,


示例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;  }
开发者ID:7heaven,项目名称:softart,代码行数:31,


示例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 );  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:11,


示例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;  }
开发者ID:JamShan,项目名称:Phoenix3D_2.1,代码行数:13,


示例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;  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:37,


示例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;  }
开发者ID:151706061,项目名称:VTK,代码行数:49,


示例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;    }  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:48,


示例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;  }
开发者ID:GaZ3ll3,项目名称:enable,代码行数:22,


示例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;  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:39,


示例16: ft_mem_table_remove

static voidft_mem_table_remove( FT_MemTable  table,                     FT_Byte*     address ){    if ( table )    {        FT_MemNode  *pnode, node;        pnode = ft_mem_table_get_nodep( table, address );        node  = *pnode;        if ( node )        {            if ( node->size < 0 )                ft_mem_debug_panic(                    "freeing memory block at %p more than once at (%s:%ld)/n"                    "block allocated at (%s:%ld) and released at (%s:%ld)",                    address,                    FT_FILENAME( table->file_name ), table->line_no,                    FT_FILENAME( node->alloc_file_name ), node->alloc_line_no,                    FT_FILENAME( node->free_file_name ), node->free_line_no );            /* we simply invert the node's size to indicate that the node */            /* was freed.  We also change its contents.                   */            FT_MEM_SET( address, 0xF3, node->size );            table->alloc_current -= node->size;            node->size            = -node->size;            node->free_file_name  = table->file_name;            node->free_line_no    = table->line_no;        }        else            ft_mem_debug_panic(                "trying to free unknown block at %p in (%s:%ld)/n",                address,                FT_FILENAME( table->file_name ), table->line_no );    }}
开发者ID:GraphicsMagick,项目名称:graphicsmagick,代码行数:38,


示例17: FT_FSpMakePath

  static OSErr  FT_FSpMakePath( const FSSpec*  spec_p,                  UInt8*         path,                  UInt32         maxPathSize )  {    OSErr   err;    FSSpec  spec = *spec_p;    short   vRefNum;    long    dirID;    Str255  parDir_name;    FT_MEM_SET( path, 0, maxPathSize );    while ( 1 )    {      int             child_namelen = ft_strlen( (char *)path );      unsigned char   node_namelen  = spec.name[0];      unsigned char*  node_name     = spec.name + 1;      if ( node_namelen + child_namelen > maxPathSize )        return errFSNameTooLong;      FT_MEM_MOVE( path + node_namelen + 1, path, child_namelen );      FT_MEM_COPY( path, node_name, node_namelen );      if ( child_namelen > 0 )        path[node_namelen] = ':';      vRefNum        = spec.vRefNum;      dirID          = spec.parID;      parDir_name[0] = '/0';      err = FSMakeFSSpec( vRefNum, dirID, parDir_name, &spec );      if ( noErr != err || dirID == spec.parID )        break;    }    return noErr;  }
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:37,


示例18: FT_Realloc

  FT_Realloc( FT_Memory  memory,              FT_Long    current,              FT_Long    size,              void**     P )  {    void*  Q;    FT_ASSERT( P != 0 );    /* if the original pointer is NULL, call FT_Alloc() */    if ( !*P )      return FT_Alloc( memory, size, P );    /* if the new block if zero-sized, clear the current one */    if ( size <= 0 )    {      FT_Free( memory, P );      return FT_Err_Ok;    }    Q = memory->realloc( memory, current, size, *P );    if ( !Q )      goto Fail;    if ( size > current )      FT_MEM_SET( (char*)Q + current, 0, size - current );    *P = Q;    return FT_Err_Ok;  Fail:    FT_ERROR(( "FT_Realloc:" ));    FT_ERROR(( " Failed (current %ld, requested %ld)/n",               current, size ));    return FT_Err_Out_Of_Memory;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:37,


示例19: ft_base_pic_init

  FT_Error  ft_base_pic_init( FT_Library  library )  {    FT_PIC_Container*  pic_container = &library->pic_container;    FT_Error           error         = FT_Err_Ok;    BasePIC*           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->base = container;    /* initialize default modules list and pointers */    error = ft_create_default_module_classes( library );    if ( error )      goto Exit;    /* initialize pointer table -                       */    /* this is how the module usually expects this data */    FT_Init_Class_ft_outline_glyph_class(      &container->ft_outline_glyph_class );    FT_Init_Class_ft_bitmap_glyph_class(      &container->ft_bitmap_glyph_class );#ifdef FT_CONFIG_OPTION_MAC_FONTS    FT_Init_Table_ft_raccess_guess_table(      (ft_raccess_guess_rec*)&container->ft_raccess_guess_table );#endif  Exit:    if ( error )      ft_base_pic_free( library );    return error;  }
开发者ID:Johnny-Martin,项目名称:ComBase,代码行数:36,


示例20: TT_New_GlyphZone

  TT_New_GlyphZone( FT_Memory     memory,                    FT_UShort     maxPoints,                    FT_Short      maxContours,                    TT_GlyphZone  zone )  {    FT_Error  error;    if ( maxPoints > 0 )      maxPoints += 2;    FT_MEM_SET( zone, 0, sizeof ( *zone ) );    zone->memory = memory;    if ( FT_NEW_ARRAY( zone->org,      maxPoints * 2 ) ||         FT_NEW_ARRAY( zone->cur,      maxPoints * 2 ) ||         FT_NEW_ARRAY( zone->tags,     maxPoints     ) ||         FT_NEW_ARRAY( zone->contours, maxContours   ) )    {      TT_Done_GlyphZone( zone );    }    return error;  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:24,


示例21: ah_outline_compute_segments

//.........这里部分代码省略.........              /* compute segment size */              min_pos = max_pos = point->v;              v = segment->first->v;              if ( v < min_pos )                min_pos = v;              if ( v > max_pos )                max_pos = v;              segment->min_coord = min_pos;              segment->max_coord = max_pos;              on_edge = 0;              num_segments++;              segment++;              /* fallthrough */            }          }          /* now exit if we are at the start/end point */          if ( point == last )          {            if ( passed )              break;            passed = 1;          }          if ( !on_edge && ABS( point->out_dir ) == major_dir )          {            /* this is the start of a new segment! */            segment_dir = point->out_dir;            /* clear all segment fields */            FT_MEM_SET( segment, 0, sizeof ( *segment ) );            segment->dir      = segment_dir;            segment->flags    = ah_edge_normal;            min_pos = max_pos = point->u;            segment->first    = point;            segment->last     = point;            segment->contour  = contour;            on_edge           = 1;#ifdef AH_HINT_METRICS            if ( point == max_point )              max_point = 0;            if ( point == min_point )              min_point = 0;#endif          }          point = point->next;        }      } /* contours */#ifdef AH_HINT_METRICS      /* we need to ensure that there are edges on the left-most and  */      /* right-most points of the glyph in order to hint the metrics; */      /* we do this by inserting fake segments when needed            */      if ( dimension == 0 )      {        AH_Point*  point       =  outline->points;        AH_Point*  point_limit =  point + outline->num_points;
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:66,


示例22: CFF_Size_Init

  CFF_Size_Init( CFF_Size  size )  {    FT_Error           error = 0;    PSH_Globals_Funcs  funcs = CFF_Size_Get_Globals_Funcs( size );    if ( funcs )    {      PSH_Globals    globals;      CFF_Face       face    = (CFF_Face)size->face;      CFF_Font       font    = (CFF_FontRec *)face->extra.data;      CFF_SubFont    subfont = &font->top_font;      CFF_Private    cpriv   = &subfont->private_dict;      PS_PrivateRec  priv;      /* IMPORTANT: The CFF and Type1 private dictionaries have    */      /*            slightly different structures; we need to      */      /*            synthetize a type1 dictionary on the fly here. */      {        FT_UInt  n, count;        FT_MEM_SET( &priv, 0, sizeof ( priv ) );        count = priv.num_blue_values = cpriv->num_blue_values;        for ( n = 0; n < count; n++ )          priv.blue_values[n] = (FT_Short)cpriv->blue_values[n];        count = priv.num_other_blues = cpriv->num_other_blues;        for ( n = 0; n < count; n++ )          priv.other_blues[n] = (FT_Short)cpriv->other_blues[n];        count = priv.num_family_blues = cpriv->num_family_blues;        for ( n = 0; n < count; n++ )          priv.family_blues[n] = (FT_Short)cpriv->family_blues[n];        count = priv.num_family_other_blues = cpriv->num_family_other_blues;        for ( n = 0; n < count; n++ )          priv.family_other_blues[n] = (FT_Short)cpriv->family_other_blues[n];        priv.blue_scale = cpriv->blue_scale;        priv.blue_shift = cpriv->blue_shift;        priv.blue_fuzz  = cpriv->blue_fuzz;        priv.standard_width[0]  = (FT_UShort)cpriv->standard_width;        priv.standard_height[0] = (FT_UShort)cpriv->standard_height;        count = priv.num_snap_widths = cpriv->num_snap_widths;        for ( n = 0; n < count; n++ )          priv.snap_widths[n] = (FT_Short)cpriv->snap_widths[n];        count = priv.num_snap_heights = cpriv->num_snap_heights;        for ( n = 0; n < count; n++ )          priv.snap_heights[n] = (FT_Short)cpriv->snap_heights[n];        priv.force_bold     = cpriv->force_bold;        priv.language_group = cpriv->language_group;        priv.lenIV          = cpriv->lenIV;      }      error = funcs->create( size->face->memory, &priv, &globals );      if ( !error )        size->internal = (FT_Size_Internal)(void*)globals;    }    return error;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:70,


示例23: autofit_module_class_pic_init

FT_Errorautofit_module_class_pic_init( FT_Library  library ){    FT_PIC_Container*  pic_container = &library->pic_container;    FT_UInt            ss;    FT_Error           error         = FT_Err_Ok;    AFModulePIC*       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->autofit = container;    /* initialize pointer table -                       */    /* this is how the module usually expects this data */    error = FT_Create_Class_af_services( library,                                         &container->af_services );    if ( error )        goto Exit;    FT_Init_Class_af_service_properties( &container->af_service_properties );    for ( ss = 0; ss < AF_WRITING_SYSTEM_MAX; ss++ )        container->af_writing_system_classes[ss] =            &container->af_writing_system_classes_rec[ss];    container->af_writing_system_classes[AF_WRITING_SYSTEM_MAX] = NULL;    for ( ss = 0; ss < AF_SCRIPT_MAX; ss++ )        container->af_script_classes[ss] =            &container->af_script_classes_rec[ss];    container->af_script_classes[AF_SCRIPT_MAX] = NULL;    for ( ss = 0; ss < AF_STYLE_MAX; ss++ )        container->af_style_classes[ss] =            &container->af_style_classes_rec[ss];    container->af_style_classes[AF_STYLE_MAX] = NULL;#undef  WRITING_SYSTEM#define WRITING_SYSTEM( ws, WS )                             /        FT_Init_Class_af_ ## ws ## _writing_system_class(    /          &container->af_writing_system_classes_rec[ss++] );    ss = 0;#include "afwrtsys.h"#undef  SCRIPT#define SCRIPT( s, S, d, h, H, sss )                 /        FT_Init_Class_af_ ## s ## _script_class(     /          &container->af_script_classes_rec[ss++] );    ss = 0;#include "afscript.h"#undef  STYLE#define STYLE( s, S, d, ws, sc, bss, c )            /        FT_Init_Class_af_ ## s ## _style_class(     /          &container->af_style_classes_rec[ss++] );    ss = 0;#include "afstyles.h"    FT_Init_Class_af_autofitter_interface(        library, &container->af_autofitter_interface );Exit:    if ( error )        autofit_module_class_pic_free( library );    return error;}
开发者ID:93i,项目名称:godot,代码行数:72,


示例24: af_face_globals_compute_script_coverage

 /* this function is used to compute the script index of each glyph  * within a given face  */  static FT_Error  af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )  {    FT_Error    error       = 0;    FT_Face     face        = globals->face;    FT_CharMap  old_charmap = face->charmap;    FT_Byte*    gscripts    = globals->glyph_scripts;    FT_UInt     ss;   /* the value 255 means "uncovered glyph"    */    FT_MEM_SET( globals->glyph_scripts,                AF_SCRIPT_LIST_NONE,                globals->glyph_count );    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );    if ( error )    {     /* ignore this error, we'll simply use Latin as the standard      * script. XXX: Shouldn't we rather disable hinting ??      */      error = 0;      goto Exit;    }   /* scan each script in a Unicode charmap    */    for ( ss = 0; af_script_classes[ss]; ss++ )    {      AF_ScriptClass      clazz = af_script_classes[ss];      AF_Script_UniRange  range;      if ( clazz->script_uni_ranges == NULL )        continue;     /* scan all unicode points in the range, and set the corresponding      * glyph script index      */      for ( range = clazz->script_uni_ranges; range->first != 0; range++ )      {        FT_ULong  charcode = range->first;        FT_UInt   gindex;        gindex = FT_Get_Char_Index( face, charcode );        if ( gindex != 0                               &&             gindex < globals->glyph_count             &&             gscripts[ gindex ] == AF_SCRIPT_LIST_NONE )        {          gscripts[ gindex ] = (FT_Byte) ss;        }        for (;;)        {          charcode = FT_Get_Next_Char( face, charcode, &gindex );          if ( gindex == 0 || charcode > range->last )            break;          if ( gindex < globals->glyph_count       &&               gscripts[ gindex ] == AF_SCRIPT_LIST_NONE )          {            gscripts[ gindex ] = (FT_Byte) ss;          }        }      }    }  Exit:   /* by default, all uncovered glyphs are set to the latin script    * XXX: shouldnt' we disable hinting or do something similar ?    */    {      FT_UInt  nn;      for ( nn = 0; nn < globals->glyph_count; nn++ )      {        if ( gscripts[ nn ] == AF_SCRIPT_LIST_NONE )          gscripts[ nn ] = AF_SCRIPT_LIST_DEFAULT;      }    }    FT_Set_Charmap( face, old_charmap );    return error;  }
开发者ID:zdementor,项目名称:my-deps,代码行数:87,


示例25: CID_New_Parser

  CID_New_Parser( CID_Parser*    parser,                  FT_Stream      stream,                  FT_Memory      memory,                  PSAux_Service  psaux )  {    FT_Error  error;    FT_ULong  base_offset, offset, ps_len;    FT_Byte   buffer[256 + 10];    FT_Int    buff_len;    FT_MEM_SET( parser, 0, sizeof ( *parser ) );    psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );    parser->stream = stream;    base_offset = FT_STREAM_POS();    /* first of all, check the font format in the  header */    if ( FT_FRAME_ENTER( 31 ) )      goto Exit;    if ( ft_strncmp( (char *)stream->cursor,                     "%!PS-Adobe-3.0 Resource-CIDFont", 31 ) )    {      FT_TRACE2(( "[not a valid CID-keyed font]/n" ));      error = CID_Err_Unknown_File_Format;    }    FT_FRAME_EXIT();    if ( error )      goto Exit;    /* now, read the rest of the file, until we find a `StartData' */    buff_len = 256;    for (;;)    {      FT_Byte   *p, *limit = buffer + 256;      FT_ULong  top_position;      /* fill input buffer */      buff_len -= 256;      if ( buff_len > 0 )        FT_MEM_MOVE( buffer, limit, buff_len );      p = buffer + buff_len;      if ( FT_STREAM_READ( p, 256 + 10 - buff_len ) )        goto Exit;      top_position = FT_STREAM_POS() - buff_len;      buff_len = 256 + 10;      /* look for `StartData' */      for ( p = buffer; p < limit; p++ )      {        if ( p[0] == 'S' && ft_strncmp( (char*)p, "StartData", 9 ) == 0 )        {          /* save offset of binary data after `StartData' */          offset = (FT_ULong)( top_position - ( limit - p ) + 10 );          goto Found;        }      }    }  Found:    /* we have found the start of the binary data.  We will now        */    /* rewind and extract the frame of corresponding to the Postscript */    /* section                                                         */    ps_len = offset - base_offset;    if ( FT_STREAM_SEEK( base_offset )                    ||         FT_FRAME_EXTRACT( ps_len, parser->postscript ) )      goto Exit;    parser->data_offset    = offset;    parser->postscript_len = ps_len;    parser->root.base      = parser->postscript;    parser->root.cursor    = parser->postscript;    parser->root.limit     = parser->root.cursor + ps_len;    parser->num_dict       = -1;  Exit:    return error;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:86,


示例26: ft_mem_table_remove

  static void  ft_mem_table_remove( FT_MemTable  table,                       FT_Byte*     address,                       FT_Long      delta )  {    if ( table )    {      FT_MemNode  *pnode, node;      pnode = ft_mem_table_get_nodep( table, address );      node  = *pnode;      if ( node )      {        FT_MemSource  source;        if ( node->size < 0 )          ft_mem_debug_panic(            "freeing memory block at %p more than once at (%s:%ld)/n"            "block allocated at (%s:%ld) and released at (%s:%ld)",            address,            FT_FILENAME( _ft_debug_file ), _ft_debug_lineno,            FT_FILENAME( node->source->file_name ), node->source->line_no,            FT_FILENAME( node->free_file_name ), node->free_line_no );        /* scramble the node's content for additional safety */        FT_MEM_SET( address, 0xF3, node->size );        if ( delta == 0 )        {          source = node->source;          source->cur_blocks--;          source->cur_size -= node->size;          table->alloc_current -= node->size;        }        if ( table->keep_alive )        {          /* we simply invert the node's size to indicate that the node */          /* was freed.                                                 */          node->size           = -node->size;          node->free_file_name = _ft_debug_file;          node->free_line_no   = _ft_debug_lineno;        }        else        {          table->nodes--;          *pnode = node->link;          node->size   = 0;          node->source = NULL;          ft_mem_table_free( table, node );          if ( table->nodes * 3 < table->size  ||               table->size  * 3 < table->nodes )            ft_mem_table_resize( table );        }      }      else        ft_mem_debug_panic(          "trying to free unknown block at %p in (%s:%ld)/n",          address,          FT_FILENAME( _ft_debug_file ), _ft_debug_lineno );    }  }
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:70,


示例27: af_face_globals_compute_style_coverage

  static FT_Error  af_face_globals_compute_style_coverage( AF_FaceGlobals  globals )  {    FT_Error    error;    FT_Face     face        = globals->face;    FT_CharMap  old_charmap = face->charmap;    FT_Byte*    gstyles     = globals->glyph_styles;    FT_UInt     ss;    FT_UInt     i;    FT_UInt     dflt        = -1;    /* the value AF_STYLE_UNASSIGNED means `uncovered glyph' */    FT_MEM_SET( globals->glyph_styles,                AF_STYLE_UNASSIGNED,                globals->glyph_count );    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );    if ( error )    {      /*       * Ignore this error; we simply use the fallback style.       * XXX: Shouldn't we rather disable hinting?       */      error = FT_Err_Ok;      goto Exit;    }    /* scan each style in a Unicode charmap */    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )    {      AF_StyleClass       style_class =                            AF_STYLE_CLASSES_GET[ss];      AF_ScriptClass      script_class =                            AF_SCRIPT_CLASSES_GET[style_class->script];      AF_Script_UniRange  range;      if ( script_class->script_uni_ranges == NULL )        continue;      /*       *  Scan all Unicode points in the range and set the corresponding       *  glyph style index.       */      if ( style_class->coverage == AF_COVERAGE_DEFAULT )      {        if ( style_class->script == globals->module->default_script )          dflt = ss;        for ( range = script_class->script_uni_ranges;              range->first != 0;              range++ )        {          FT_ULong  charcode = range->first;          FT_UInt   gindex;          gindex = FT_Get_Char_Index( face, charcode );          if ( gindex != 0                             &&               gindex < (FT_ULong)globals->glyph_count &&               gstyles[gindex] == AF_STYLE_UNASSIGNED  )            gstyles[gindex] = (FT_Byte)ss;          for (;;)          {            charcode = FT_Get_Next_Char( face, charcode, &gindex );            if ( gindex == 0 || charcode > range->last )              break;            if ( gindex < (FT_ULong)globals->glyph_count &&                 gstyles[gindex] == AF_STYLE_UNASSIGNED  )              gstyles[gindex] = (FT_Byte)ss;          }        }      }      else      {        /* get glyphs not directly addressable by cmap */        af_get_coverage( globals, style_class, gstyles );      }    }    /* handle the default OpenType features of the default script ... */    af_get_coverage( globals, AF_STYLE_CLASSES_GET[dflt], gstyles );    /* ... and the remaining default OpenType features */    for ( ss = 0; AF_STYLE_CLASSES_GET[ss]; ss++ )    {      AF_StyleClass  style_class = AF_STYLE_CLASSES_GET[ss];      if ( ss != dflt && style_class->coverage == AF_COVERAGE_DEFAULT )        af_get_coverage( globals, style_class, gstyles );    }    /* mark ASCII digits */    for ( i = 0x30; i <= 0x39; i++ )//.........这里部分代码省略.........
开发者ID:ONLYOFFICE,项目名称:core,代码行数:101,


示例28: tt_check_trickyness_sfnt_ids

//.........这里部分代码省略.........            { 0xA0604633UL, 0x00001DE8UL }  /* prep */        },        {   /* NEC fangot5.ttc */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0x40AA774CUL, 0x000001CBUL }, /* fpgm */            { 0x9B5CAA96UL, 0x00001F9AUL }  /* prep */        },        {   /* NEC fanmin3.ttc */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0x0D3DE9CBUL, 0x00000141UL }, /* fpgm */            { 0xD4127766UL, 0x00002280UL }  /* prep */        },        {   /* NEC FA-Gothic, 1996 */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0x4A692698UL, 0x000001F0UL }, /* fpgm */            { 0x340D4346UL, 0x00001FCAUL }  /* prep */        },        {   /* NEC FA-Minchou, 1996 */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0xCD34C604UL, 0x00000166UL }, /* fpgm */            { 0x6CF31046UL, 0x000022B0UL }  /* prep */        },        {   /* NEC FA-RoundGothicB, 1996 */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0x5DA75315UL, 0x0000019DUL }, /* fpgm */            { 0x40745A5FUL, 0x000022E0UL }  /* prep */        },        {   /* NEC FA-RoundGothicM, 1996 */            { 0x00000000UL, 0x00000000UL }, /* cvt  */            { 0xF055FC48UL, 0x000001C2UL }, /* fpgm */            { 0x3900DED3UL, 0x00001E18UL }  /* prep */        }    };    FT_ULong   checksum;    int        num_matched_ids[TRICK_SFNT_IDS_NUM_FACES];    FT_Bool    has_cvt, has_fpgm, has_prep;    FT_UShort  i;    int        j, k;    FT_MEM_SET( num_matched_ids, 0,                sizeof ( int ) * TRICK_SFNT_IDS_NUM_FACES );    has_cvt  = FALSE;    has_fpgm = FALSE;    has_prep = FALSE;    for ( i = 0; i < face->num_tables; i++ )    {        checksum = 0;        switch( face->dir_tables[i].Tag )        {        case TTAG_cvt:            k = TRICK_SFNT_ID_cvt;            has_cvt  = TRUE;            break;        case TTAG_fpgm:            k = TRICK_SFNT_ID_fpgm;            has_fpgm = TRUE;            break;        case TTAG_prep:            k = TRICK_SFNT_ID_prep;            has_prep = TRUE;            break;        default:            continue;        }        for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )            if ( face->dir_tables[i].Length == sfnt_id[j][k].Length )            {                if ( !checksum )                    checksum = tt_get_sfnt_checksum( face, i );                if ( sfnt_id[j][k].CheckSum == checksum )                    num_matched_ids[j]++;                if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )                    return TRUE;            }    }    for ( j = 0; j < TRICK_SFNT_IDS_NUM_FACES; j++ )    {        if ( !has_cvt  && !sfnt_id[j][TRICK_SFNT_ID_cvt].Length )            num_matched_ids[j] ++;        if ( !has_fpgm && !sfnt_id[j][TRICK_SFNT_ID_fpgm].Length )            num_matched_ids[j] ++;        if ( !has_prep && !sfnt_id[j][TRICK_SFNT_ID_prep].Length )            num_matched_ids[j] ++;        if ( num_matched_ids[j] == TRICK_SFNT_IDS_PER_FACE )            return TRUE;    }    return FALSE;}
开发者ID:Ruw-Van,项目名称:krkrz,代码行数:101,


示例29: af_face_globals_compute_script_coverage

  static FT_Error  af_face_globals_compute_script_coverage( AF_FaceGlobals  globals )  {    FT_Error    error       = AF_Err_Ok;    FT_Face     face        = globals->face;    FT_CharMap  old_charmap = face->charmap;    FT_Byte*    gscripts    = globals->glyph_scripts;    FT_UInt     ss, i;    /* the value 255 means `uncovered glyph' */    FT_MEM_SET( globals->glyph_scripts,                AF_SCRIPT_LIST_NONE,                globals->glyph_count );    error = FT_Select_Charmap( face, FT_ENCODING_UNICODE );    if ( error )    {     /*      *  Ignore this error; we simply use the default script.      *  XXX: Shouldn't we rather disable hinting?      */      error = AF_Err_Ok;      goto Exit;    }    /* scan each script in a Unicode charmap */    for ( ss = 0; AF_SCRIPT_CLASSES_GET[ss]; ss++ )    {      AF_ScriptClass      clazz = AF_SCRIPT_CLASSES_GET[ss];      AF_Script_UniRange  range;      if ( clazz->script_uni_ranges == NULL )        continue;      /*       *  Scan all unicode points in the range and set the corresponding       *  glyph script index.       */      for ( range = clazz->script_uni_ranges; range->first != 0; range++ )      {        FT_ULong  charcode = range->first;        FT_UInt   gindex;        gindex = FT_Get_Char_Index( face, charcode );        if ( gindex != 0                             &&             gindex < (FT_ULong)globals->glyph_count &&             gscripts[gindex] == AF_SCRIPT_LIST_NONE )        {          gscripts[gindex] = (FT_Byte)ss;        }        for (;;)        {          charcode = FT_Get_Next_Char( face, charcode, &gindex );          if ( gindex == 0 || charcode > range->last )            break;          if ( gindex < (FT_ULong)globals->glyph_count &&               gscripts[gindex] == AF_SCRIPT_LIST_NONE )          {            gscripts[gindex] = (FT_Byte)ss;          }        }      }    }    /* mark ASCII digits */    for ( i = 0x30; i <= 0x39; i++ )    {      FT_UInt  gindex = FT_Get_Char_Index( face, i );      if ( gindex != 0 && gindex < (FT_ULong)globals->glyph_count )        gscripts[gindex] |= AF_DIGIT;    }  Exit:    /*     *  By default, all uncovered glyphs are set to the latin script.     *  XXX: Shouldn't we disable hinting or do something similar?     */    {      FT_Long  nn;      for ( nn = 0; nn < globals->glyph_count; nn++ )      {        if ( ( gscripts[nn] & ~AF_DIGIT ) == AF_SCRIPT_LIST_NONE )        {          gscripts[nn] &= ~AF_SCRIPT_LIST_NONE;          gscripts[nn] |= AF_SCRIPT_LIST_DEFAULT;        }      }    }//.........这里部分代码省略.........
开发者ID:Try,项目名称:Tempest,代码行数:101,


示例30: FT_New_Face_From_FOND

  FT_New_Face_From_FOND( FT_Library  library,                         Handle      fond,                         FT_Long     face_index,                         FT_Face*    aface )  {    short     have_sfnt, have_lwfn = 0;    ResID     sfnt_id, fond_id;    OSType    fond_type;    Str255    fond_name;    Str255    lwfn_file_name;    UInt8     path_lwfn[PATH_MAX];    OSErr     err;    FT_Error  error = FT_Err_Ok;    /* test for valid `aface' and `library' delayed to */    /* `FT_New_Face_From_XXX'                          */    GetResInfo( fond, &fond_id, &fond_type, fond_name );    if ( ResError() != noErr || fond_type != TTAG_FOND )      return FT_THROW( Invalid_File_Format );    HLock( fond );    parse_fond( *fond, &have_sfnt, &sfnt_id, lwfn_file_name, face_index );    HUnlock( fond );    if ( lwfn_file_name[0] )    {      ResFileRefNum  res;      res = HomeResFile( fond );      if ( noErr != ResError() )        goto found_no_lwfn_file;#if HAVE_FSREF      {        UInt8  path_fond[PATH_MAX];        FSRef  ref;        err = FSGetForkCBInfo( res, kFSInvalidVolumeRefNum,                               NULL, NULL, NULL, &ref, NULL );        if ( noErr != err )          goto found_no_lwfn_file;        err = FSRefMakePath( &ref, path_fond, sizeof ( path_fond ) );        if ( noErr != err )          goto found_no_lwfn_file;        error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,                                     path_lwfn, sizeof ( path_lwfn ) );        if ( !error )          have_lwfn = 1;      }#elif HAVE_FSSPEC      {        UInt8     path_fond[PATH_MAX];        FCBPBRec  pb;        Str255    fond_file_name;        FSSpec    spec;        FT_MEM_SET( &spec, 0, sizeof ( FSSpec ) );        FT_MEM_SET( &pb,   0, sizeof ( FCBPBRec ) );        pb.ioNamePtr = fond_file_name;        pb.ioVRefNum = 0;        pb.ioRefNum  = res;        pb.ioFCBIndx = 0;        err = PBGetFCBInfoSync( &pb );        if ( noErr != err )          goto found_no_lwfn_file;        err = FSMakeFSSpec( pb.ioFCBVRefNum, pb.ioFCBParID,                            fond_file_name, &spec );        if ( noErr != err )          goto found_no_lwfn_file;        err = FT_FSpMakePath( &spec, path_fond, sizeof ( path_fond ) );        if ( noErr != err )          goto found_no_lwfn_file;        error = lookup_lwfn_by_fond( path_fond, lwfn_file_name,                                     path_lwfn, sizeof ( path_lwfn ) );        if ( !error )          have_lwfn = 1;      }#endif /* HAVE_FSREF, HAVE_FSSPEC */    }    if ( have_lwfn && ( !have_sfnt || PREFER_LWFN ) )      error = FT_New_Face_From_LWFN( library,                                     path_lwfn,//.........这里部分代码省略.........
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:101,



注:本文中的FT_MEM_SET函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ FT_MEM_ZERO函数代码示例
C++ FT_MEM_COPY函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。