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

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

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

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

在下文中一共展示了FT_MEM_COPY函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: FT_Stream_TryRead

  FT_Stream_TryRead( FT_Stream  stream,                     FT_Byte*   buffer,                     FT_ULong   count )  {    FT_ULong  read_bytes = 0;    if ( stream->pos >= stream->size )      goto Exit;    if ( stream->read )      read_bytes = stream->read( stream, stream->pos, buffer, count );    else    {      read_bytes = stream->size - stream->pos;      if ( read_bytes > count )        read_bytes = count;      FT_MEM_COPY( buffer, stream->base + stream->pos, read_bytes );    }    stream->pos += read_bytes;  Exit:    return read_bytes;  }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:26,


示例2: cff_index_get_name

  cff_index_get_name( CFF_Font  font,                      FT_UInt   element )  {    CFF_Index   idx = &font->name_index;    FT_Memory   memory = idx->stream->memory;    FT_Byte*    bytes;    FT_ULong    byte_len;    FT_Error    error;    FT_String*  name = 0;    error = cff_index_access_element( idx, element, &bytes, &byte_len );    if ( error )      goto Exit;    if ( !FT_ALLOC( name, byte_len + 1 ) )    {      FT_MEM_COPY( name, bytes, byte_len );      name[byte_len] = 0;    }    cff_index_forget_element( idx, &bytes );  Exit:    return name;  }
开发者ID:ONLYOFFICE,项目名称:core,代码行数:25,


示例3: t1_get_glyph_name

  static FT_Error  t1_get_glyph_name( T1_Face     face,                     FT_UInt     glyph_index,                     FT_Pointer  buffer,                     FT_UInt     buffer_max )  {    FT_String*  gname;    gname = face->type1.glyph_names[glyph_index];    if ( buffer_max > 0 )    {      FT_UInt  len = (FT_UInt)( ft_strlen( gname ) );      if (len >= buffer_max)        len = buffer_max - 1;      FT_MEM_COPY( buffer, gname, len );      ((FT_Byte*)buffer)[len] = 0;    }    return T1_Err_Ok;  }
开发者ID:stefanhendriks,项目名称:dune2themaker,代码行数:25,


示例4: ft_bzip2_file_fill_input

  static FT_Error  ft_bzip2_file_fill_input( FT_BZip2File  zip )  {    bz_stream*  bzstream = &zip->bzstream;    FT_Stream   stream    = zip->source;    FT_ULong    size;    if ( stream->read )    {      size = stream->read( stream, stream->pos, zip->input,                           FT_BZIP2_BUFFER_SIZE );      if ( size == 0 )        return FT_THROW( Invalid_Stream_Operation );    }    else    {      size = stream->size - stream->pos;      if ( size > FT_BZIP2_BUFFER_SIZE )        size = FT_BZIP2_BUFFER_SIZE;      if ( size == 0 )        return FT_THROW( Invalid_Stream_Operation );      FT_MEM_COPY( zip->input, stream->base + stream->pos, size );    }    stream->pos += size;    bzstream->next_in  = (char*)zip->input;    bzstream->avail_in = size;    return FT_Err_Ok;  }
开发者ID:03050903,项目名称:Urho3D,代码行数:33,


示例5: FT_Get_WinFNT_Header

  FT_Get_WinFNT_Header( FT_Face               face,                        FT_WinFNT_HeaderRec  *header )  {    FT_Error  error;    error = FT_Err_Invalid_Argument;    if ( face != NULL && face->driver != NULL )    {      FT_Module  driver = (FT_Module) face->driver;      if ( driver->clazz && driver->clazz->module_name              &&           ft_strcmp( driver->clazz->module_name, "winfonts" ) == 0 )      {        FNT_Face  fnt_face = (FNT_Face)face;        FNT_Font  font     = fnt_face->font;        if ( font )        {          FT_MEM_COPY( header, &font->header, sizeof ( *header ) );          error = FT_Err_Ok;        }      }    }    return error;  }
开发者ID:CliffsDover,项目名称:graphicsmagick,代码行数:29,


示例6: ft_gzip_file_fill_input

static FT_Errorft_gzip_file_fill_input( FT_GZipFile  zip ){    z_stream*  zstream = &zip->zstream;    FT_Stream  stream  = zip->source;    FT_ULong   size;    if ( stream->read )    {        size = stream->read( stream, stream->pos, zip->input,                             FT_GZIP_BUFFER_SIZE );        if ( size == 0 )            return Gzip_Err_Invalid_Stream_Operation;    }    else    {        size = stream->size - stream->pos;        if ( size > FT_GZIP_BUFFER_SIZE )            size = FT_GZIP_BUFFER_SIZE;        if ( size == 0 )            return Gzip_Err_Invalid_Stream_Operation;        FT_MEM_COPY( zip->input, stream->base + stream->pos, size );    }    stream->pos += size;    zstream->next_in  = zip->input;    zstream->avail_in = size;    return Gzip_Err_Ok;}
开发者ID:bowlofstew,项目名称:Aquaria,代码行数:33,


示例7: reallocate_t1_table

  static FT_Error  reallocate_t1_table( PS_Table  table,                       FT_Long   new_size )  {    FT_Memory  memory   = table->memory;    FT_Byte*   old_base = table->block;    FT_Error   error;    /* allocate new base block */    if ( FT_ALLOC( table->block, new_size ) )    {      table->block = old_base;      return error;    }    /* copy elements and shift offsets */    if (old_base )    {      FT_MEM_COPY( table->block, old_base, table->capacity );      shift_elements( table, old_base );      FT_FREE( old_base );    }    table->capacity = new_size;    return PSaux_Err_Ok;  }
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:28,


示例8: cff_index_get_sid_string

  cff_index_get_sid_string( CFF_Index        idx,                            FT_UInt          sid,                            PSNames_Service  psnames_service )  {    /* if it is not a standard string, return it */    if ( sid > 390 )      return cff_index_get_name( idx, sid - 391 );    /* that's a standard string, fetch a copy from the PSName module */    {      FT_String*   name       = 0;      const char*  adobe_name = psnames_service->adobe_std_strings( sid );      FT_UInt      len;      if ( adobe_name )      {        FT_Memory  memory = idx->stream->memory;        FT_Error   error;        len = (FT_UInt)ft_strlen( adobe_name );        if ( !FT_ALLOC( name, len + 1 ) )        {          FT_MEM_COPY( name, adobe_name, len );          name[len] = 0;        }        FT_UNUSED( error );      }      return name;    }  }
开发者ID:1tgr,项目名称:mobius,代码行数:34,


示例9: cf2_arrstack_push

  cf2_arrstack_push( CF2_ArrStack  arrstack,                     const void*   ptr )  {    FT_ASSERT( arrstack != NULL );    if ( arrstack->count == arrstack->allocated )    {      /* grow the buffer by one chunk */      if ( !cf2_arrstack_setNumElements(             arrstack, arrstack->allocated + arrstack->chunk ) )      {        /* on error, ignore the push */        return;      }    }    FT_ASSERT( ptr != NULL );    {      size_t  offset = arrstack->count * arrstack->sizeItem;      void*   newPtr = (FT_Byte*)arrstack->ptr + offset;      FT_MEM_COPY( newPtr, ptr, arrstack->sizeItem );      arrstack->count += 1;    }  }
开发者ID:qaisjp,项目名称:green-candy,代码行数:27,


示例10: get_sfnt_glyph_name

  static FT_Error  get_sfnt_glyph_name( TT_Face     face,                       FT_UInt     glyph_index,                       FT_Pointer  buffer,                       FT_UInt     buffer_max )  {    FT_String*  gname;    FT_Error    error;    error = TT_Get_PS_Name( face, glyph_index, &gname );    if ( !error && buffer_max > 0 )    {      FT_UInt  len = (FT_UInt)( ft_strlen( gname ) );      if ( len >= buffer_max )        len = buffer_max - 1;      FT_MEM_COPY( buffer, gname, len );      ((FT_Byte*)buffer)[len] = 0;    }    return error;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:25,


示例11: ft_gzip_file_io

static FT_ULongft_gzip_file_io( FT_GZipFile  zip,                 FT_ULong     pos,                 FT_Byte*     buffer,                 FT_ULong     count ){    FT_ULong  result = 0;    FT_Error  error;    /* Reset inflate stream if we're seeking backwards.        */    /* Yes, that is not too efficient, but it saves memory :-) */    if ( pos < zip->pos )    {        error = ft_gzip_file_reset( zip );        if ( error )            goto Exit;    }    /* skip unwanted bytes */    if ( pos > zip->pos )    {        error = ft_gzip_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );        if ( error )            goto Exit;    }    if ( count == 0 )        goto Exit;    /* now read the data */    for (;;)    {        FT_ULong  delta;        delta = (FT_ULong)( zip->limit - zip->cursor );        if ( delta >= count )            delta = count;        FT_MEM_COPY( buffer, zip->cursor, delta );        buffer      += delta;        result      += delta;        zip->cursor += delta;        zip->pos    += delta;        count -= delta;        if ( count == 0 )            break;        error = ft_gzip_file_fill_output( zip );        if ( error )            break;    }Exit:    return result;}
开发者ID:bowlofstew,项目名称:Aquaria,代码行数:58,


示例12: FT_Bitmap_Copy

  FT_Bitmap_Copy( FT_Library        library,                  const FT_Bitmap  *source,                  FT_Bitmap        *target)  {    FT_Memory  memory = library->memory;    FT_Error   error  = FT_Err_Ok;    FT_Int     pitch  = source->pitch;    FT_ULong   size;    if ( source == target )      return FT_Err_Ok;    if ( source->buffer == NULL )    {      *target = *source;      return FT_Err_Ok;    }    if ( pitch < 0 )      pitch = -pitch;    size = (FT_ULong)( pitch * source->rows );    if ( target->buffer )    {      FT_Int    target_pitch = target->pitch;      FT_ULong  target_size;      if ( target_pitch < 0  )        target_pitch = -target_pitch;      target_size = (FT_ULong)( target_pitch * target->rows );      if ( target_size != size )        (void)FT_QREALLOC( target->buffer, target_size, size );    }    else      (void)FT_QALLOC( target->buffer, size );    if ( !error )    {      unsigned char *p;      p = target->buffer;      *target = *source;      target->buffer = p;      FT_MEM_COPY( target->buffer, source->buffer, size );    }    return error;  }
开发者ID:151706061,项目名称:PDFium,代码行数:54,


示例13: ft_outline_glyph_init

  static FT_Error  ft_outline_glyph_init( FT_OutlineGlyph  glyph,                         FT_GlyphSlot     slot )  {    FT_Error     error   = FT_Err_Ok;    FT_Library   library = FT_GLYPH(glyph)->library;    FT_Outline*  source  = &slot->outline;    FT_Outline*  target  = &glyph->outline;    /* check format in glyph slot */    if ( slot->format != ft_glyph_format_outline )    {      error = FT_Err_Invalid_Glyph_Format;      goto Exit;    }    /* allocate new outline */    error = FT_Outline_New( library, source->n_points, source->n_contours,                            &glyph->outline );    if ( error )      goto Exit;    /* copy it */    FT_MEM_COPY( target->points, source->points,              source->n_points * sizeof ( FT_Vector ) );    FT_MEM_COPY( target->tags, source->tags,              source->n_points * sizeof ( FT_Byte ) );    FT_MEM_COPY( target->contours, source->contours,              source->n_contours * sizeof ( FT_Short ) );    /* copy all flags, except the `ft_outline_owner' one */    target->flags = source->flags | ft_outline_owner;  Exit:    return error;  }
开发者ID:Claruarius,项目名称:stblinux-2.6.37,代码行数:39,


示例14: cff_get_glyph_name

  static FT_Error  cff_get_glyph_name( CFF_Face    face,                      FT_UInt     glyph_index,                      FT_Pointer  buffer,                      FT_UInt     buffer_max )  {    CFF_Font            font   = (CFF_Font)face->extra.data;    FT_Memory           memory = FT_FACE_MEMORY( face );    FT_String*          gname;    FT_UShort           sid;    FT_Service_PsCMaps  psnames;    FT_Error            error;    FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );    if ( !psnames )    {      FT_ERROR(( "cff_get_glyph_name:" ));      FT_ERROR(( " cannot get glyph name from CFF & CEF fonts/n" ));      FT_ERROR(( "                   " ));      FT_ERROR(( " without the `PSNames' module/n" ));      error = CFF_Err_Unknown_File_Format;      goto Exit;    }    /* first, locate the sid in the charset table */    sid = font->charset.sids[glyph_index];    /* now, lookup the name itself */    gname = cff_index_get_sid_string( &font->string_index, sid, psnames );    if ( gname && buffer_max > 0 )    {      FT_UInt  len = (FT_UInt)ft_strlen( gname );      if ( len >= buffer_max )        len = buffer_max - 1;      FT_MEM_COPY( buffer, gname, len );      ((FT_Byte*)buffer)[len] = 0;    }    FT_FREE( gname );    error = CFF_Err_Ok;    Exit:      return error;  }
开发者ID:EgoIncarnate,项目名称:Infinity,代码行数:49,


示例15: afm_atoindex

  /* read a glyph name and return the equivalent glyph index */  static FT_UInt  afm_atoindex( FT_Byte**  start,                FT_Byte*   limit,                T1_Font    type1 )  {    FT_Byte*    p = *start;    FT_PtrDist  len;    FT_UInt     result = 0;    char        temp[64];    /* skip whitespace */    while ( p < limit                                             &&            ( *p == ' ' || *p == '/t' || *p == ':' || *p == ';' ) )      p++;    *start = p;    /* now, read glyph name */    while ( p < limit && IS_ALPHANUM( *p ) )      p++;    len = p - *start;    if ( len > 0 && len < 64 )    {      FT_Int  n;      /* copy glyph name to intermediate array */      FT_MEM_COPY( temp, *start, len );      temp[len] = 0;      /* lookup glyph name in face array */      for ( n = 0; n < type1->num_glyphs; n++ )      {        char*  gname = (char*)type1->glyph_names[n];        if ( gname && gname[0] == temp[0] && ft_strcmp( gname, temp ) == 0 )        {          result = n;          break;        }      }    }    *start = p;    return result;  }
开发者ID:Bracket-,项目名称:psp-ports,代码行数:49,


示例16: CFF_StrCopy

  static FT_String*  CFF_StrCopy( FT_Memory         memory,               const FT_String*  source )  {    FT_Error    error;    FT_String*  result = 0;    FT_Int      len = (FT_Int)ft_strlen( source );    if ( !FT_ALLOC( result, len + 1 ) )    {      FT_MEM_COPY( result, source, len );      result[len] = 0;    }    FT_UNUSED( error );    return result;  }
开发者ID:SOLARIC,项目名称:world-opponent-network,代码行数:19,


示例17: cff_index_get_sid_string

  cff_index_get_sid_string( CFF_Index           idx,                            FT_UInt             sid,                            FT_Service_PsCMaps  psnames )  {    /* value 0xFFFFU indicates a missing dictionary entry */    if ( sid == 0xFFFFU )      return 0;    /* if it is not a standard string, return it */    if ( sid > 390 )      return cff_index_get_name( idx, sid - 391 );    /* CID-keyed CFF fonts don't have glyph names */    if ( !psnames )      return 0;    /* that's a standard string, fetch a copy from the PSName module */    {      FT_String*   name       = 0;      const char*  adobe_name = psnames->adobe_std_strings( sid );      FT_UInt      len;      if ( adobe_name )      {        FT_Memory  memory = idx->stream->memory;        FT_Error   error;        len = (FT_UInt)ft_strlen( adobe_name );        if ( !FT_ALLOC( name, len + 1 ) )        {          FT_MEM_COPY( name, adobe_name, len );          name[len] = 0;        }        FT_UNUSED( error );      }      return name;    }  }
开发者ID:OS2World,项目名称:LIB-SDL,代码行数:42,


示例18: FT_Stream_ReadAt

  FT_Stream_ReadAt( FT_Stream  stream,                    FT_ULong   pos,                    FT_Byte*   buffer,                    FT_ULong   count )  {    FT_Error  error = FT_Err_Ok;    FT_ULong  read_bytes;    if ( pos >= stream->size )    {      FT_ERROR(( "FT_Stream_ReadAt:"                 " invalid i/o; pos = 0x%lx, size = 0x%lx/n",                 pos, stream->size ));      return FT_Err_Invalid_Stream_Operation;    }    if ( stream->read )      read_bytes = stream->read( stream, pos, buffer, count );    else    {      read_bytes = stream->size - pos;      if ( read_bytes > count )        read_bytes = count;      FT_MEM_COPY( buffer, stream->base + pos, read_bytes );    }    stream->pos = pos + read_bytes;    if ( read_bytes < count )    {      FT_ERROR(( "FT_Stream_ReadAt:"                 " invalid read; expected %lu bytes, got %lu/n",                 count, read_bytes ));      error = FT_Err_Invalid_Stream_Operation;    }    return error;  }
开发者ID:2or3,项目名称:PlaygroundOSS,代码行数:42,


示例19: ftc_sbit_copy_bitmap

  static FT_Error  ftc_sbit_copy_bitmap( FTC_SBit    sbit,                        FT_Bitmap*  bitmap,                        FT_Memory   memory )  {    FT_Error  error;    FT_Int    pitch = bitmap->pitch;    FT_ULong  size;    if ( pitch < 0 )      pitch = -pitch;    size = (FT_ULong)( pitch * bitmap->rows );    if ( !FT_ALLOC( sbit->buffer, size ) )      FT_MEM_COPY( sbit->buffer, bitmap->buffer, size );    return error;  }
开发者ID:Aggroo,项目名称:nebula-trifid,代码行数:20,


示例20: pfr_aux_name_load

  /*   * Load a name from the auxiliary data.  Since this extracts undocumented   * strings from the font file, we need to be careful here.   */  static FT_Error  pfr_aux_name_load( FT_Byte*     p,                     FT_UInt      len,                     FT_Memory    memory,                     FT_String*  *astring )  {    FT_Error    error  = FT_Err_Ok;    FT_String*  result = NULL;    FT_UInt     n, ok;    if ( *astring )      FT_FREE( *astring );    if ( len > 0 && p[len - 1] == 0 )      len--;    /* check that each character is ASCII  */    /* for making sure not to load garbage */    ok = ( len > 0 );    for ( n = 0; n < len; n++ )      if ( p[n] < 32 || p[n] > 127 )      {        ok = 0;        break;      }    if ( ok )    {      if ( FT_ALLOC( result, len + 1 ) )        goto Exit;      FT_MEM_COPY( result, p, len );      result[len] = 0;    }  Exit:    *astring = result;    return error;  }
开发者ID:ImageMagick,项目名称:ttf,代码行数:44,


示例21: pfr_extra_item_load_font_id

  pfr_extra_item_load_font_id( FT_Byte*     p,                               FT_Byte*     limit,                               PFR_PhyFont  phy_font )  {    FT_Error   error  = FT_Err_Ok;    FT_Memory  memory = phy_font->memory;    FT_UInt    len    = (FT_UInt)( limit - p );    if ( phy_font->font_id )      goto Exit;    if ( FT_ALLOC( phy_font->font_id, len + 1 ) )      goto Exit;    /* copy font ID name, and terminate it for safety */    FT_MEM_COPY( phy_font->font_id, p, len );    phy_font->font_id[len] = 0;  Exit:    return error;  }
开发者ID:ImageMagick,项目名称:ttf,代码行数:22,


示例22: ft_bitmap_copy

  static FT_Error  ft_bitmap_copy( FT_Memory   memory,                  FT_Bitmap*  source,                  FT_Bitmap*  target )  {    FT_Error  error;    FT_Int    pitch = source->pitch;    FT_ULong  size;    *target = *source;    if ( pitch < 0 )      pitch = -pitch;    size = (FT_ULong)( pitch * source->rows );    if ( !FT_ALLOC( target->buffer, size ) )      FT_MEM_COPY( target->buffer, source->buffer, size );    return error;  }
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:22,


示例23: 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,


示例24: FT_Stream_ReadFields

  FT_Stream_ReadFields( FT_Stream              stream,                        const FT_Frame_Field*  fields,                        void*                  structure )  {    FT_Error  error;    FT_Bool   frame_accessed = 0;    FT_Byte*  cursor = stream->cursor;    if ( !fields || !stream )      return FT_Err_Invalid_Argument;    error = FT_Err_Ok;    do    {      FT_ULong  value;      FT_Int    sign_shift;      FT_Byte*  p;      switch ( fields->value )      {      case ft_frame_start:  /* access a new frame */        error = FT_Stream_EnterFrame( stream, fields->offset );        if ( error )          goto Exit;        frame_accessed = 1;        cursor         = stream->cursor;        fields++;        continue;  /* loop! */      case ft_frame_bytes:  /* read a byte sequence */      case ft_frame_skip:   /* skip some bytes      */        {          FT_UInt  len = fields->size;          if ( cursor + len > stream->limit )          {            error = FT_Err_Invalid_Stream_Operation;            goto Exit;          }          if ( fields->value == ft_frame_bytes )          {            p = (FT_Byte*)structure + fields->offset;            FT_MEM_COPY( p, cursor, len );          }          cursor += len;          fields++;          continue;        }      case ft_frame_byte:      case ft_frame_schar:  /* read a single byte */        value = FT_NEXT_BYTE(cursor);        sign_shift = 24;        break;      case ft_frame_short_be:      case ft_frame_ushort_be:  /* read a 2-byte big-endian short */        value = FT_NEXT_USHORT(cursor);        sign_shift = 16;        break;      case ft_frame_short_le:      case ft_frame_ushort_le:  /* read a 2-byte little-endian short */        value = FT_NEXT_USHORT_LE(cursor);        sign_shift = 16;        break;      case ft_frame_long_be:      case ft_frame_ulong_be:  /* read a 4-byte big-endian long */        value = FT_NEXT_ULONG(cursor);        sign_shift = 0;        break;      case ft_frame_long_le:      case ft_frame_ulong_le:  /* read a 4-byte little-endian long */        value = FT_NEXT_ULONG_LE(cursor);        sign_shift = 0;        break;      case ft_frame_off3_be:      case ft_frame_uoff3_be:  /* read a 3-byte big-endian long */        value = FT_NEXT_UOFF3(cursor);        sign_shift = 8;        break;      case ft_frame_off3_le:      case ft_frame_uoff3_le:  /* read a 3-byte little-endian long */        value = FT_NEXT_UOFF3_LE(cursor);        sign_shift = 8;        break;      default:        /* otherwise, exit the loop */        stream->cursor = cursor;        goto Exit;//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:101,


示例25: ft_metaclass_get_class

  static FT_Class  ft_metaclass_get_class( FT_MetaClass  meta,                          FT_Type       ctype )  {    FT_ClassHNodeRec   keynode, *node, **pnode;    FT_Memory          memory;    FT_ClassRec*       clazz;    FT_Class           parent;    FT_Error           error;    keynode.hnode.hash = FT_TYPE_HASH( ctype );    keynode.type       = ctype;    pnode = (FT_ClassHNode*) ft_hash_lookup( &meta->type_to_class,                                             (FT_HashNode) &keynode );    node  = *pnode;    if ( node != NULL )    {      clazz = (FT_ClassRec*) node->clazz;      goto Exit;    }    memory = FT_CLASS__MEMORY(meta);    clazz  = NULL;    parent = NULL;    if ( ctype->super != NULL )    {      FT_ASSERT( ctype->super->class_size <= ctype->class_size );      FT_ASSERT( ctype->super->obj_size   <= ctype->obj_size   );      parent = ft_metaclass_get_class( meta, ctype->super );    }    if ( !FT_NEW( node ) )    {      if ( !FT_ALLOC( clazz, ctype->class_size ) )      {        if ( parent )          FT_MEM_COPY( (FT_ClassRec*)clazz, parent, parent->type->class_size );        clazz->object.clazz     = (FT_Class) meta;        clazz->object.ref_count = 1;        clazz->memory  = memory;        clazz->library = FT_CLASS__LIBRARY(meta);        clazz->super   = parent;        clazz->type    = ctype;        clazz->info    = NULL;        clazz->magic   = FT_MAGIC_CLASS;        clazz->class_done = ctype->class_done;        clazz->obj_size   = ctype->obj_size;        clazz->obj_init   = ctype->obj_init;        clazz->obj_done   = ctype->obj_done;        if ( parent )        {          if ( clazz->class_done == NULL )            clazz->class_done = parent->class_done;          if ( clazz->obj_init == NULL )            clazz->obj_init = parent->obj_init;          if ( clazz->obj_done == NULL )            clazz->obj_done = parent->obj_done;        }        /* find class initializer, if any */        {          FT_Type             ztype = ctype;          FT_Object_InitFunc  cinit = NULL;          do          {            cinit = ztype->class_init;            if ( cinit != NULL )              break;            ztype = ztype->super;          }          while ( ztype != NULL );          /* then call it when needed */          if ( cinit != NULL )            error = cinit( (FT_Object) clazz, NULL );        }      }      if (error)      {        if ( clazz )        {          /* we always call the class destructor when    */          /* an error was detected in the constructor !! */          if ( clazz->class_done )            clazz->class_done( (FT_Object) clazz );          FT_FREE( clazz );        }        FT_FREE( node );//.........这里部分代码省略.........
开发者ID:1tgr,项目名称:mobius,代码行数:101,


示例26: RunIns

//.........这里部分代码省略.........          printf( "freedom    (%04hx,%04hx)/n", exc->GS.freeVector.x,                                                exc->GS.freeVector.y );          printf( "projection (%04hx,%04hx)/n", exc->GS.projVector.x,                                                exc->GS.projVector.y );          printf( "dual       (%04hx,%04hx)/n/n", exc->GS.dualVector.x,                                                  exc->GS.dualVector.y );          break;        /* Show graphics state */        case 'g':          printf( "rounding   %s/n", round_str[exc->GS.round_state] );          printf( "min dist   %04lx/n", exc->GS.minimum_distance );          printf( "cvt_cutin  %04lx/n", exc->GS.control_value_cutin );          printf( "RP 0,1,2   %4x %4x %4x/n", exc->GS.rp0, exc->GS.rp1, exc->GS.rp2 );          break;        /* Show points table */        case 'p':          for ( A = 0; A < exc->pts.n_points; A++ )          {            printf( "%3hd  ", A );            printf( "(%6d,%6d) - ", pts.orus[A].x, pts.orus[A].y );            printf( "(%8ld,%8ld) - ", pts.org[A].x, pts.org[A].y );            printf( "(%8ld,%8ld)/n",  pts.cur[A].x, pts.cur[A].y );          }          printf(( "/n" ));          break;        default:          key = 1;        }      } while ( !key );      FT_MEM_COPY( save.org,   pts.org, pts.n_points * sizeof ( FT_Vector ) );      FT_MEM_COPY( save.cur,   pts.cur, pts.n_points * sizeof ( FT_Vector ) );      FT_MEM_COPY( save.tags, pts.tags, pts.n_points );      /* a return indicate the last command */      if (ch == '/r')        ch = oldch;      switch ( ch )      {      /* Quit debugger */      case 'q':        goto LErrorLabel_;      /* Step over */      case 'n':        if ( exc->IP < exc->codeSize )        {          /* `step over' is equivalent to `step into' except if  */          /* the current opcode is a CALL or LOOPCALL            */          if ( CUR.opcode != 0x2a && CUR.opcode != 0x2b )            goto Step_into;          /* otherwise, loop execution until we reach the next opcode */          next_IP = CUR.IP + CUR.length;          while ( exc->IP != next_IP )          {            if ( ( error = TT_RunIns( exc ) ) != 0 )              goto LErrorLabel_;          }        }        oldch = ch;        break;
开发者ID:xahgo,项目名称:tama,代码行数:67,


示例27: FT_Bitmap_Copy

  FT_Bitmap_Copy( FT_Library        library,                  const FT_Bitmap  *source,                  FT_Bitmap        *target)  {    FT_Memory  memory;    FT_Error   error  = FT_Err_Ok;    FT_Int    pitch;    FT_ULong  size;    FT_Int  source_pitch_sign, target_pitch_sign;    if ( !library )      return FT_THROW( Invalid_Library_Handle );    if ( !source || !target )      return FT_THROW( Invalid_Argument );    if ( source == target )      return FT_Err_Ok;    source_pitch_sign = source->pitch < 0 ? -1 : 1;    target_pitch_sign = target->pitch < 0 ? -1 : 1;    if ( source->buffer == NULL )    {      *target = *source;      if ( source_pitch_sign != target_pitch_sign )        target->pitch = -target->pitch;      return FT_Err_Ok;    }    memory = library->memory;    pitch  = source->pitch;    if ( pitch < 0 )      pitch = -pitch;    size = (FT_ULong)pitch * source->rows;    if ( target->buffer )    {      FT_Int    target_pitch = target->pitch;      FT_ULong  target_size;      if ( target_pitch < 0 )        target_pitch = -target_pitch;      target_size = (FT_ULong)target_pitch * target->rows;      if ( target_size != size )        (void)FT_QREALLOC( target->buffer, target_size, size );    }    else      (void)FT_QALLOC( target->buffer, size );    if ( !error )    {      unsigned char *p;      p = target->buffer;      *target = *source;      target->buffer = p;      if ( source_pitch_sign == target_pitch_sign )        FT_MEM_COPY( target->buffer, source->buffer, size );      else      {        /* take care of bitmap flow */        FT_UInt   i;        FT_Byte*  s = source->buffer;        FT_Byte*  t = target->buffer;        t += pitch * ( target->rows - 1 );        for ( i = target->rows; i > 0; i-- )        {          FT_ARRAY_COPY( t, s, pitch );          s += pitch;          t -= pitch;        }      }    }    return error;  }
开发者ID:03050903,项目名称:libgdx,代码行数:90,


示例28: ft_lzw_file_io

  static FT_ULong  ft_lzw_file_io( FT_LZWFile  zip,                  FT_ULong    pos,                  FT_Byte*    buffer,                  FT_ULong    count )  {    FT_ULong  result = 0;    FT_Error  error;    /* seeking backwards. */    if ( pos < zip->pos )    {      /* If the new position is within the output buffer, simply       */      /* decrement pointers, otherwise we reset the stream completely! */      if ( ( zip->pos - pos ) <= (FT_ULong)( zip->cursor - zip->buffer ) )      {        zip->cursor -= zip->pos - pos;        zip->pos     = pos;      }      else      {        error = ft_lzw_file_reset( zip );        if ( error )          goto Exit;      }    }    /* skip unwanted bytes */    if ( pos > zip->pos )    {      error = ft_lzw_file_skip_output( zip, (FT_ULong)( pos - zip->pos ) );      if ( error )        goto Exit;    }    if ( count == 0 )      goto Exit;    /* now read the data */    for (;;)    {      FT_ULong  delta;      delta = (FT_ULong)( zip->limit - zip->cursor );      if ( delta >= count )        delta = count;      FT_MEM_COPY( buffer + result, zip->cursor, delta );      result      += delta;      zip->cursor += delta;      zip->pos    += delta;      count -= delta;      if ( count == 0 )        break;      error = ft_lzw_file_fill_output( zip );      if ( error )        break;    }  Exit:    return result;  }
开发者ID:CarloMaker,项目名称:Urho3D,代码行数:66,


示例29: RunIns

//.........这里部分代码省略.........          }          else            printf( "not yet in `glyf' program/n" );          for ( A = 0; A < CUR.pts.n_points; A++ )          {            printf( "%3d  ",                    A );            printf( "(%6ld,%6ld) - ",                    pts.orus[A].x, pts.orus[A].y );            if ( use_float )            {              printf( "(%8.2f,%8.2f) - ",                      pts.org[A].x / 64.0, pts.org[A].y / 64.0 );              printf( "(%8.2f,%8.2f)/n",                      pts.cur[A].x / 64.0, pts.cur[A].y / 64.0 );            }            else            {              printf( "(%8ld,%8ld) - ",                      pts.org[A].x, pts.org[A].y );              printf( "(%8ld,%8ld)/n",                      pts.cur[A].x, pts.cur[A].y );            }          }          printf( "/n" );          break;        default:          key = 1;        }      } while ( !key );      FT_MEM_COPY( save.org, pts.org, pts.n_points * sizeof ( FT_Vector ) );      FT_MEM_COPY( save.cur, pts.cur, pts.n_points * sizeof ( FT_Vector ) );      FT_MEM_COPY( save.tags, pts.tags, pts.n_points );      /* a return indicates the last command */      if ( ch == '/r' )        ch = oldch;      switch ( ch )      {      /* quit debugger */      case 'q':        error = Quit;        goto LErrorLabel_;      /* continue */      case 'c':        if ( CUR.IP < CUR.codeSize )        {          /* loop execution until we reach end of current code range */          while ( CUR.IP < CUR.codeSize )          {            if ( ( error = TT_RunIns( exc ) ) != 0 )              goto LErrorLabel_;          }        }      /* step over */      case 'n':        if ( CUR.IP < CUR.codeSize )        {          /* `step over' is equivalent to `step into' except if */          /* the current opcode is a CALL or LOOPCALL           */
开发者ID:Frankie-666,项目名称:color-emoji.freetype2-demos,代码行数:67,


示例30: cff_index_get_pointers

  /* entries to C-style strings (this is, NULL-terminated).       */  static FT_Error  cff_index_get_pointers( CFF_Index   idx,                          FT_Byte***  table,                          FT_Byte**   pool )  {    FT_Error   error     = FT_Err_Ok;    FT_Memory  memory    = idx->stream->memory;    FT_Byte**  t         = NULL;    FT_Byte*   new_bytes = NULL;    *table = NULL;    if ( idx->offsets == NULL )    {      error = cff_index_load_offsets( idx );      if ( error )        goto Exit;    }    if ( idx->count > 0                                        &&         !FT_NEW_ARRAY( t, idx->count + 1 )                    &&         ( !pool || !FT_ALLOC( new_bytes,                               idx->data_size + idx->count ) ) )    {      FT_ULong  n, cur_offset;      FT_ULong  extra = 0;      FT_Byte*  org_bytes = idx->bytes;      /* at this point, `idx->offsets' can't be NULL */      cur_offset = idx->offsets[0] - 1;      /* sanity check */      if ( cur_offset != 0 )      {        FT_TRACE0(( "cff_index_get_pointers:"                    " invalid first offset value %d set to zero/n",                    cur_offset ));        cur_offset = 0;      }      if ( !pool )        t[0] = org_bytes + cur_offset;      else        t[0] = new_bytes + cur_offset;      for ( n = 1; n <= idx->count; n++ )      {        FT_ULong  next_offset = idx->offsets[n] - 1;        /* two sanity checks for invalid offset tables */        if ( next_offset < cur_offset )          next_offset = cur_offset;        else if ( next_offset > idx->data_size )          next_offset = idx->data_size;        if ( !pool )          t[n] = org_bytes + next_offset;        else        {          t[n] = new_bytes + next_offset + extra;          if ( next_offset != cur_offset )          {            FT_MEM_COPY( t[n - 1], org_bytes + cur_offset, t[n] - t[n - 1] );            t[n][0] = '/0';            t[n]   += 1;            extra++;          }        }        cur_offset = next_offset;      }      *table = t;      if ( pool )        *pool = new_bytes;    }  Exit:    return error;  }
开发者ID:ONLYOFFICE,项目名称:core,代码行数:86,



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


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