亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? cffload.c

?? 智能設(shè)備中PDF閱讀器的源碼!用于windows mobile2003或者WM5以上
?? C
?? 第 1 頁 / 共 4 頁
字號(hào):
  {
    if ( idx->stream )
    {
      FT_Stream  stream = idx->stream;
      FT_Memory  memory = stream->memory;


      if ( idx->bytes )
        FT_FRAME_RELEASE( idx->bytes );

      FT_FREE( idx->offsets );
      FT_MEM_ZERO( idx, sizeof ( *idx ) );
    }
  }


  /* allocate a table containing pointers to an index's elements */
  static FT_Error
  cff_index_get_pointers( CFF_Index   idx,
                          FT_Byte***  table )
  {
    FT_Error   error  = CFF_Err_Ok;
    FT_Memory  memory = idx->stream->memory;
    FT_ULong   n, offset, old_offset;
    FT_Byte**  t;


    *table = 0;

    if ( idx->count > 0 && !FT_NEW_ARRAY( t, idx->count + 1 ) )
    {
      old_offset = 1;
      for ( n = 0; n <= idx->count; n++ )
      {
        offset = idx->offsets[n];
        if ( !offset )
          offset = old_offset;

        t[n] = idx->bytes + offset - 1;

        old_offset = offset;
      }
      *table = t;
    }

    return error;
  }


  FT_LOCAL_DEF( FT_Error )
  cff_index_access_element( CFF_Index  idx,
                            FT_UInt    element,
                            FT_Byte**  pbytes,
                            FT_ULong*  pbyte_len )
  {
    FT_Error  error = CFF_Err_Ok;


    if ( idx && idx->count > element )
    {
      /* compute start and end offsets */
      FT_ULong  off1, off2 = 0;


      off1 = idx->offsets[element];
      if ( off1 )
      {
        do
        {
          element++;
          off2 = idx->offsets[element];

        } while ( off2 == 0 && element < idx->count );

        if ( !off2 )
          off1 = 0;
      }

      /* access element */
      if ( off1 && off2 > off1 )
      {
        *pbyte_len = off2 - off1;

        if ( idx->bytes )
        {
          /* this index was completely loaded in memory, that's easy */
          *pbytes = idx->bytes + off1 - 1;
        }
        else
        {
          /* this index is still on disk/file, access it through a frame */
          FT_Stream  stream = idx->stream;


          if ( FT_STREAM_SEEK( idx->data_offset + off1 - 1 ) ||
               FT_FRAME_EXTRACT( off2 - off1, *pbytes )      )
            goto Exit;
        }
      }
      else
      {
        /* empty index element */
        *pbytes    = 0;
        *pbyte_len = 0;
      }
    }
    else
      error = CFF_Err_Invalid_Argument;

  Exit:
    return error;
  }


  FT_LOCAL_DEF( void )
  cff_index_forget_element( CFF_Index  idx,
                            FT_Byte**  pbytes )
  {
    if ( idx->bytes == 0 )
    {
      FT_Stream  stream = idx->stream;


      FT_FRAME_RELEASE( *pbytes );
    }
  }


  FT_LOCAL_DEF( FT_String* )
  cff_index_get_name( CFF_Index  idx,
                      FT_UInt    element )
  {
    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;
  }


  FT_LOCAL_DEF( FT_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;
    }
  }


  /*************************************************************************/
  /*************************************************************************/
  /***                                                                   ***/
  /***   FD Select table support                                         ***/
  /***                                                                   ***/
  /*************************************************************************/
  /*************************************************************************/


  static void
  CFF_Done_FD_Select( CFF_FDSelect  fdselect,
                      FT_Stream     stream )
  {
    if ( fdselect->data )
      FT_FRAME_RELEASE( fdselect->data );

    fdselect->data_size   = 0;
    fdselect->format      = 0;
    fdselect->range_count = 0;
  }


  static FT_Error
  CFF_Load_FD_Select( CFF_FDSelect  fdselect,
                      FT_UInt       num_glyphs,
                      FT_Stream     stream,
                      FT_ULong      offset )
  {
    FT_Error  error;
    FT_Byte   format;
    FT_UInt   num_ranges;


    /* read format */
    if ( FT_STREAM_SEEK( offset ) || FT_READ_BYTE( format ) )
      goto Exit;

    fdselect->format      = format;
    fdselect->cache_count = 0;   /* clear cache */

    switch ( format )
    {
    case 0:     /* format 0, that's simple */
      fdselect->data_size = num_glyphs;
      goto Load_Data;

    case 3:     /* format 3, a tad more complex */
      if ( FT_READ_USHORT( num_ranges ) )
        goto Exit;

      fdselect->data_size = num_ranges * 3 + 2;

    Load_Data:
      if ( FT_FRAME_EXTRACT( fdselect->data_size, fdselect->data ) )
        goto Exit;
      break;

    default:    /* hmm... that's wrong */
      error = CFF_Err_Invalid_File_Format;
    }

  Exit:
    return error;
  }


  FT_LOCAL_DEF( FT_Byte )
  cff_fd_select_get( CFF_FDSelect  fdselect,
                     FT_UInt       glyph_index )
  {
    FT_Byte  fd = 0;


    switch ( fdselect->format )
    {
    case 0:
      fd = fdselect->data[glyph_index];
      break;

    case 3:
      /* first, compare to cache */
      if ( (FT_UInt)( glyph_index - fdselect->cache_first ) <
                        fdselect->cache_count )
      {
        fd = fdselect->cache_fd;
        break;
      }

      /* then, lookup the ranges array */
      {
        FT_Byte*  p       = fdselect->data;
        FT_Byte*  p_limit = p + fdselect->data_size;
        FT_Byte   fd2;
        FT_UInt   first, limit;


        first = FT_NEXT_USHORT( p );
        do
        {
          if ( glyph_index < first )
            break;

          fd2   = *p++;
          limit = FT_NEXT_USHORT( p );

          if ( glyph_index < limit )
          {
            fd = fd2;

            /* update cache */
            fdselect->cache_first = first;
            fdselect->cache_count = limit-first;
            fdselect->cache_fd    = fd2;
            break;
          }
          first = limit;

        } while ( p < p_limit );
      }
      break;

    default:
      ;
    }

    return fd;
  }


  /*************************************************************************/
  /*************************************************************************/
  /***                                                                   ***/
  /***   CFF font support                                                ***/
  /***                                                                   ***/
  /*************************************************************************/
  /*************************************************************************/

  static void
  cff_charset_done( CFF_Charset  charset,
                    FT_Stream    stream )
  {
    FT_Memory  memory = stream->memory;


    FT_FREE( charset->sids );
    FT_FREE( charset->cids );
    charset->format = 0;
    charset->offset = 0;
  }


  static FT_Error
  cff_charset_load( CFF_Charset  charset,
                    FT_UInt      num_glyphs,
                    FT_Stream    stream,
                    FT_ULong     base_offset,
                    FT_ULong     offset,
                    FT_Bool      invert )
  {
    FT_Memory  memory = stream->memory;
    FT_Error   error  = CFF_Err_Ok;
    FT_UShort  glyph_sid;


    /* If the the offset is greater than 2, we have to parse the */
    /* charset table.                                            */
    if ( offset > 2 )
    {
      FT_UInt  j;


      charset->offset = base_offset + offset;

      /* Get the format of the table. */
      if ( FT_STREAM_SEEK( charset->offset ) ||
           FT_READ_BYTE( charset->format )   )
        goto Exit;

      /* Allocate memory for sids. */
      if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )
        goto Exit;

      /* assign the .notdef glyph */
      charset->sids[0] = 0;

      switch ( charset->format )
      {
      case 0:
        if ( num_glyphs > 0 )
        {
          if ( FT_FRAME_ENTER( ( num_glyphs - 1 ) * 2 ) )
            goto Exit;

          for ( j = 1; j < num_glyphs; j++ )
            charset->sids[j] = FT_GET_USHORT();

          FT_FRAME_EXIT();
        }
        break;

      case 1:
      case 2:
        {
          FT_UInt  nleft;
          FT_UInt  i;


          j = 1;

          while ( j < num_glyphs )
          {
            /* Read the first glyph sid of the range. */
            if ( FT_READ_USHORT( glyph_sid ) )
              goto Exit;

            /* Read the number of glyphs in the range.  */
            if ( charset->format == 2 )
            {
              if ( FT_READ_USHORT( nleft ) )
                goto Exit;
            }
            else
            {
              if ( FT_READ_BYTE( nleft ) )
                goto Exit;
            }

            /* Fill in the range of sids -- `nleft + 1' glyphs. */
            for ( i = 0; j < num_glyphs && i <= nleft; i++, j++, glyph_sid++ )
              charset->sids[j] = glyph_sid;
          }
        }
        break;

      default:
        FT_ERROR(( "cff_charset_load: invalid table format!\n" ));
        error = CFF_Err_Invalid_File_Format;
        goto Exit;
      }
    }
    else
    {
      /* Parse default tables corresponding to offset == 0, 1, or 2.  */
      /* CFF specification intimates the following:                   */
      /*                                                              */
      /* In order to use a predefined charset, the following must be  */
      /* true: The charset constructed for the glyphs in the font's   */
      /* charstrings dictionary must match the predefined charset in  */
      /* the first num_glyphs.                                        */

      charset->offset = offset;  /* record charset type */

      switch ( (FT_UInt)offset )
      {
      case 0:
        if ( num_glyphs > 229 )
        {
          FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                     "predefined charset (Adobe ISO-Latin)!\n" ));
          error = CFF_Err_Invalid_File_Format;
          goto Exit;
        }

        /* Allocate memory for sids. */
        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )
          goto Exit;

        /* Copy the predefined charset into the allocated memory. */
        FT_ARRAY_COPY( charset->sids, cff_isoadobe_charset, num_glyphs );

        break;

      case 1:
        if ( num_glyphs > 166 )
        {
          FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                     "predefined charset (Adobe Expert)!\n" ));
          error = CFF_Err_Invalid_File_Format;
          goto Exit;
        }

        /* Allocate memory for sids. */
        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )
          goto Exit;

        /* Copy the predefined charset into the allocated memory.     */
        FT_ARRAY_COPY( charset->sids, cff_expert_charset, num_glyphs );

        break;

      case 2:
        if ( num_glyphs > 87 )
        {
          FT_ERROR(( "cff_charset_load: implicit charset larger than\n"
                     "predefined charset (Adobe Expert Subset)!\n" ));
          error = CFF_Err_Invalid_File_Format;
          goto Exit;
        }

        /* Allocate memory for sids. */
        if ( FT_NEW_ARRAY( charset->sids, num_glyphs ) )
          goto Exit;

        /* Copy the predefined charset into the allocated memory.     */
        FT_ARRAY_COPY( charset->sids, cff_expertsubset_charset, num_glyphs );

        break;

      default:
        error = CFF_Err_Invalid_File_Format;
        goto Exit;
      }
    }

    /* we have to invert the `sids' array for subsetted CID-keyed fonts */
    if ( invert )
    {
      FT_UInt    i;
      FT_UShort  max_cid = 0;


      for ( i = 0; i < num_glyphs; i++ )
        if ( charset->sids[i] > max_cid )
          max_cid = charset->sids[i];
      max_cid++;

      if ( FT_NEW_ARRAY( charset->cids, max_cid ) )
        goto Exit;
      FT_MEM_ZERO( charset->cids, sizeof ( FT_UShort ) * max_cid );

      for ( i = 0; i < num_glyphs; i++ )
        charset->cids[charset->sids[i]] = (FT_UShort)i;

      charset->max_cid = max_cid;
    }

  Exit:
    /* Clean up if there was an error. */
    if ( error )
    {
      FT_FREE( charset->sids );
      FT_FREE( charset->cids );
      charset->format = 0;
      charset->offset = 0;
      charset->sids   = 0;
    }

    return error;
  }


  static void
  cff_encoding_done( CFF_Encoding  encoding )
  {
    encoding->format = 0;
    encoding->offset = 0;
    encoding->count  = 0;
  }


  static FT_Error
  cff_encoding_load( CFF_Encoding  encoding,
                     CFF_Charset   charset,
                     FT_UInt       num_glyphs,
                     FT_Stream     stream,
                     FT_ULong      base_offset,
                     FT_ULong      offset )
  {
    FT_Error   error = CFF_Err_Ok;
    FT_UInt    count;
    FT_UInt    j;
    FT_UShort  glyph_sid;
    FT_UInt    glyph_code;


    /* Check for charset->sids.  If we do not have this, we fail. */
    if ( !charset->sids )
    {
      error = CFF_Err_Invalid_File_Format;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美午夜影院一区| 日韩视频一区二区在线观看| 激情图区综合网| 日韩综合小视频| 日日摸夜夜添夜夜添精品视频 | 欧美精品一区二区三| 337p亚洲精品色噜噜| 欧美日韩国产123区| 欧美日本在线视频| 69久久99精品久久久久婷婷| 3d动漫精品啪啪| 日韩欧美国产综合在线一区二区三区 | 欧洲av在线精品| 91极品美女在线| 欧美色图第一页| 欧美人伦禁忌dvd放荡欲情| 欧美精品1区2区3区| 欧美一区二区三区免费观看视频 | 中文字幕一区在线观看视频| 国产精品短视频| 亚洲精品高清视频在线观看| 亚洲一区二区三区激情| 五月激情六月综合| 久久电影网电视剧免费观看| 国产永久精品大片wwwapp | 中文字幕乱码一区二区免费| 国产精品久线在线观看| 亚洲免费高清视频在线| 午夜电影一区二区三区| 美脚の诱脚舐め脚责91| 国产剧情在线观看一区二区| 不卡视频免费播放| 欧美色图免费看| 欧美成人性战久久| 日本一区二区三区电影| 一区二区三区美女视频| 五月综合激情网| 国产精品一区二区果冻传媒| 91理论电影在线观看| 在线不卡欧美精品一区二区三区| 欧美精品一区二区蜜臀亚洲| 日韩美女精品在线| 日韩avvvv在线播放| 国产99久久久久| 欧美丝袜第三区| www国产成人| 樱桃视频在线观看一区| 久久97超碰国产精品超碰| 99国产精品一区| 日韩色在线观看| 亚洲欧美日韩系列| 久久精品国产在热久久| 色中色一区二区| 欧美xxx久久| 亚洲男女毛片无遮挡| 久久精品国产77777蜜臀| 972aa.com艺术欧美| 精品免费99久久| 亚洲曰韩产成在线| 狠狠色狠狠色综合| 欧美三级资源在线| 国产日韩欧美精品一区| 水野朝阳av一区二区三区| 国产成人精品亚洲777人妖| 欧美日本在线视频| 亚洲欧美一区二区三区久本道91| 九九国产精品视频| 欧美网站一区二区| 亚洲欧美怡红院| 国产精品自拍毛片| 欧美一区二区福利视频| 亚洲人成在线观看一区二区| 久久99精品久久久久久国产越南| 欧美无乱码久久久免费午夜一区| 亚洲欧洲成人精品av97| 国产一区二区在线观看视频| 欧美人xxxx| 亚洲综合视频网| 99精品视频在线观看| 国产日产欧美一区| 久久电影网电视剧免费观看| 欧美精品日韩精品| 亚洲午夜久久久久久久久电影网| 成人不卡免费av| 国产午夜亚洲精品午夜鲁丝片| 日本女人一区二区三区| 欧美日韩一二区| 一区二区在线免费观看| av亚洲产国偷v产偷v自拍| 国产午夜精品一区二区三区四区| 麻豆一区二区在线| 91超碰这里只有精品国产| 亚洲乱码中文字幕| 91在线精品一区二区| 国产精品乱码妇女bbbb| 国产69精品久久久久777| 久久亚洲精品小早川怜子| 麻豆国产一区二区| 日韩一区二区在线观看视频 | 黄页网站大全一区二区| 日韩一区二区三区视频| 日本三级亚洲精品| 91精品国产丝袜白色高跟鞋| 日韩黄色片在线观看| 欧美美女视频在线观看| 午夜精品久久久久久不卡8050| 欧美精品日韩一本| 青青草国产成人av片免费| 日韩欧美美女一区二区三区| 久久成人18免费观看| 精品国精品国产尤物美女| 另类小说欧美激情| 日韩欧美的一区二区| 九色|91porny| 国产三级精品视频| 成人美女视频在线看| 亚洲视频中文字幕| 欧美性猛片aaaaaaa做受| 午夜精品福利视频网站| 日韩写真欧美这视频| 久久国产精品一区二区| 久久久久久久久久久久久女国产乱 | 亚洲一区二区三区四区的| 欧美三级日韩三级| 免费成人av在线播放| 久久综合九色综合欧美就去吻| 国产成人免费视频网站| 国产精品久久久久永久免费观看| 91小视频在线免费看| 亚洲成人一区二区| 精品女同一区二区| 福利一区在线观看| 一区二区国产视频| 欧美一区二区三区在线观看| 国产尤物一区二区| 亚洲精品老司机| 欧美一级国产精品| 成人丝袜高跟foot| 亚洲综合色婷婷| 欧美大胆人体bbbb| av动漫一区二区| 亚洲va中文字幕| 久久精品日韩一区二区三区| 92精品国产成人观看免费| 视频一区视频二区中文| 久久精品亚洲乱码伦伦中文| 91久久精品国产91性色tv | 51精品久久久久久久蜜臀| 国产麻豆精品95视频| 亚洲视频免费在线观看| 91精品国产色综合久久不卡电影 | 日韩欧美在线影院| 成人av电影在线观看| 三级欧美在线一区| 国产精品久久久久久户外露出| 欧美日韩亚洲高清一区二区| 国产成人精品亚洲777人妖| 亚洲午夜在线电影| 久久久影院官网| 欧美日韩五月天| 成人午夜伦理影院| 美腿丝袜一区二区三区| 亚洲色大成网站www久久九九| 日韩视频永久免费| 欧美色视频一区| 成人av动漫网站| 国内精品伊人久久久久av一坑| 亚洲综合视频在线观看| 久久久久99精品一区| 欧美日韩综合色| 成人精品国产福利| 极品少妇xxxx精品少妇| 性感美女久久精品| 亚洲色图清纯唯美| 久久久久国产精品人| 日韩精品一区二区在线观看| 在线视频综合导航| 99久久久久久| 国产精品一区二区久激情瑜伽| 蜜臀国产一区二区三区在线播放| 亚洲黄色在线视频| 国产精品久久久久久亚洲伦| 精品国产91九色蝌蚪| 在线电影欧美成精品| 91国产视频在线观看| 波多野洁衣一区| 国产酒店精品激情| 久久精品国产99国产| 蜜桃一区二区三区四区| 亚洲午夜久久久久久久久电影网| 国产精品久久久久久一区二区三区| 久久久久亚洲蜜桃| 精品久久国产字幕高潮| 欧美二区三区91| 欧美高清视频在线高清观看mv色露露十八 | 国产精品一品二品| 久久成人免费电影| 久久国产日韩欧美精品| 美女一区二区在线观看| 日韩不卡在线观看日韩不卡视频|