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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cffload.c

?? 智能設備中PDF閱讀器的源碼!用于windows mobile2003或者WM5以上
?? C
?? 第 1 頁 / 共 4 頁
字號:
      goto Exit;
    }

    /* Zero out the code to gid/sid mappings. */
    for ( j = 0; j < 256; j++ )
    {
      encoding->sids [j] = 0;
      encoding->codes[j] = 0;
    }

    /* Note: The encoding table in a CFF font is indexed by glyph index;  */
    /* the first encoded glyph index is 1.  Hence, we read the character  */
    /* code (`glyph_code') at index j and make the assignment:            */
    /*                                                                    */
    /*    encoding->codes[glyph_code] = j + 1                             */
    /*                                                                    */
    /* We also make the assignment:                                       */
    /*                                                                    */
    /*    encoding->sids[glyph_code] = charset->sids[j + 1]               */
    /*                                                                    */
    /* This gives us both a code to GID and a code to SID mapping.        */

    if ( offset > 1 )
    {
      encoding->offset = base_offset + offset;

      /* we need to parse the table to determine its size */
      if ( FT_STREAM_SEEK( encoding->offset ) ||
           FT_READ_BYTE( encoding->format )   ||
           FT_READ_BYTE( count )              )
        goto Exit;

      switch ( encoding->format & 0x7F )
      {
      case 0:
        {
          FT_Byte*  p;


          /* By convention, GID 0 is always ".notdef" and is never */
          /* coded in the font.  Hence, the number of codes found  */
          /* in the table is `count+1'.                            */
          /*                                                       */
          encoding->count = count + 1;

          if ( FT_FRAME_ENTER( count ) )
            goto Exit;

          p = (FT_Byte*)stream->cursor;

          for ( j = 1; j <= count; j++ )
          {
            glyph_code = *p++;

            /* Make sure j is not too big. */
            if ( j < num_glyphs )
            {
              /* Assign code to GID mapping. */
              encoding->codes[glyph_code] = (FT_UShort)j;

              /* Assign code to SID mapping. */
              encoding->sids[glyph_code] = charset->sids[j];
            }
          }

          FT_FRAME_EXIT();
        }
        break;

      case 1:
        {
          FT_UInt  nleft;
          FT_UInt  i = 1;
          FT_UInt  k;


          encoding->count = 0;

          /* Parse the Format1 ranges. */
          for ( j = 0;  j < count; j++, i += nleft )
          {
            /* Read the first glyph code of the range. */
            if ( FT_READ_BYTE( glyph_code ) )
              goto Exit;

            /* Read the number of codes in the range. */
            if ( FT_READ_BYTE( nleft ) )
              goto Exit;

            /* Increment nleft, so we read `nleft + 1' codes/sids. */
            nleft++;

            /* compute max number of character codes */
            if ( (FT_UInt)nleft > encoding->count )
              encoding->count = nleft;

            /* Fill in the range of codes/sids. */
            for ( k = i; k < nleft + i; k++, glyph_code++ )
            {
              /* Make sure k is not too big. */
              if ( k < num_glyphs && glyph_code < 256 )
              {
                /* Assign code to GID mapping. */
                encoding->codes[glyph_code] = (FT_UShort)k;

                /* Assign code to SID mapping. */
                encoding->sids[glyph_code] = charset->sids[k];
              }
            }
          }

          /* simple check; one never knows what can be found in a font */
          if ( encoding->count > 256 )
            encoding->count = 256;
        }
        break;

      default:
        FT_ERROR(( "cff_encoding_load: invalid table format!\n" ));
        error = CFF_Err_Invalid_File_Format;
        goto Exit;
      }

      /* Parse supplemental encodings, if any. */
      if ( encoding->format & 0x80 )
      {
        FT_UInt  gindex;


        /* count supplements */
        if ( FT_READ_BYTE( count ) )
          goto Exit;

        for ( j = 0; j < count; j++ )
        {
          /* Read supplemental glyph code. */
          if ( FT_READ_BYTE( glyph_code ) )
            goto Exit;

          /* Read the SID associated with this glyph code. */
          if ( FT_READ_USHORT( glyph_sid ) )
            goto Exit;

          /* Assign code to SID mapping. */
          encoding->sids[glyph_code] = glyph_sid;

          /* First, look up GID which has been assigned to */
          /* SID glyph_sid.                                */
          for ( gindex = 0; gindex < num_glyphs; gindex++ )
          {
            if ( charset->sids[gindex] == glyph_sid )
            {
              encoding->codes[glyph_code] = (FT_UShort)gindex;
              break;
            }
          }
        }
      }
    }
    else
    {
      FT_UInt i;


      /* We take into account the fact a CFF font can use a predefined */
      /* encoding without containing all of the glyphs encoded by this */
      /* encoding (see the note at the end of section 12 in the CFF    */
      /* specification).                                               */

      switch ( (FT_UInt)offset )
      {
      case 0:
        /* First, copy the code to SID mapping. */
        FT_ARRAY_COPY( encoding->sids, cff_standard_encoding, 256 );
        goto Populate;

      case 1:
        /* First, copy the code to SID mapping. */
        FT_ARRAY_COPY( encoding->sids, cff_expert_encoding, 256 );

      Populate:
        /* Construct code to GID mapping from code to SID mapping */
        /* and charset.                                           */

        encoding->count = 0;

        for ( j = 0; j < 256; j++ )
        {
          /* If j is encoded, find the GID for it. */
          if ( encoding->sids[j] )
          {
            for ( i = 1; i < num_glyphs; i++ )
              /* We matched, so break. */
              if ( charset->sids[i] == encoding->sids[j] )
                break;

            /* i will be equal to num_glyphs if we exited the above */
            /* loop without a match.  In this case, we also have to */
            /* fix the code to SID mapping.                         */
            if ( i == num_glyphs )
            {
              encoding->codes[j] = 0;
              encoding->sids [j] = 0;
            }
            else
            {
              encoding->codes[j] = (FT_UShort)i;

              /* update encoding count */
              if ( encoding->count < j + 1 )
                encoding->count = j + 1;
            }
          }
        }
        break;

      default:
        FT_ERROR(( "cff_encoding_load: invalid table format!\n" ));
        error = CFF_Err_Invalid_File_Format;
        goto Exit;
      }
    }

  Exit:

    /* Clean up if there was an error. */
    return error;
  }


  static FT_Error
  cff_subfont_load( CFF_SubFont  font,
                    CFF_Index    idx,
                    FT_UInt      font_index,
                    FT_Stream    stream,
                    FT_ULong     base_offset )
  {
    FT_Error         error;
    CFF_ParserRec    parser;
    FT_Byte*         dict = NULL;
    FT_ULong         dict_len;
    CFF_FontRecDict  top  = &font->font_dict;
    CFF_Private      priv = &font->private_dict;


    cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict );

    /* set defaults */
    FT_MEM_ZERO( top, sizeof ( *top ) );

    top->underline_position  = -100L << 16;
    top->underline_thickness = 50L << 16;
    top->charstring_type     = 2;
    top->font_matrix.xx      = 0x10000L;
    top->font_matrix.yy      = 0x10000L;
    top->cid_count           = 8720;

    /* we use the implementation specific SID value 0xFFFF to indicate */
    /* missing entries                                                 */
    top->version             = 0xFFFFU;
    top->notice              = 0xFFFFU;
    top->copyright           = 0xFFFFU;
    top->full_name           = 0xFFFFU;
    top->family_name         = 0xFFFFU;
    top->weight              = 0xFFFFU;
    top->embedded_postscript = 0xFFFFU;

    top->cid_registry        = 0xFFFFU;
    top->cid_ordering        = 0xFFFFU;
    top->cid_font_name       = 0xFFFFU;

    error = cff_index_access_element( idx, font_index, &dict, &dict_len ) ||
            cff_parser_run( &parser, dict, dict + dict_len );

    cff_index_forget_element( idx, &dict );

    if ( error )
      goto Exit;
 
    /* if it is a CID font, we stop there */
    if ( top->cid_registry != 0xFFFFU )
      goto Exit;

    /* parse the private dictionary, if any */
    if ( top->private_offset && top->private_size )
    {
      /* set defaults */
      FT_MEM_ZERO( priv, sizeof ( *priv ) );

      priv->blue_shift       = 7;
      priv->blue_fuzz        = 1;
      priv->lenIV            = -1;
      priv->expansion_factor = (FT_Fixed)( 0.06 * 0x10000L );
      priv->blue_scale       = (FT_Fixed)( 0.039625 * 0x10000L * 1000 );

      cff_parser_init( &parser, CFF_CODE_PRIVATE, priv );

      if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||
           FT_FRAME_ENTER( font->font_dict.private_size )                 )
        goto Exit;

      error = cff_parser_run( &parser,
                              (FT_Byte*)stream->cursor,
                              (FT_Byte*)stream->limit );
      FT_FRAME_EXIT();
      if ( error )
        goto Exit;

      /* ensure that `num_blue_values' is even */
      priv->num_blue_values &= ~1;
    }

    /* read the local subrs, if any */
    if ( priv->local_subrs_offset )
    {
      if ( FT_STREAM_SEEK( base_offset + top->private_offset +
                           priv->local_subrs_offset ) )
        goto Exit;

      error = cff_new_index( &font->local_subrs_index, stream, 1 );
      if ( error )
        goto Exit;

      font->num_local_subrs = font->local_subrs_index.count;
      error = cff_index_get_pointers( &font->local_subrs_index,
                                      &font->local_subrs );
      if ( error )
        goto Exit;
    }

  Exit:
    return error;
  }


  static void
  cff_subfont_done( FT_Memory    memory,
                    CFF_SubFont  subfont )
  {
    if ( subfont )
    {
      cff_done_index( &subfont->local_subrs_index );
      FT_FREE( subfont->local_subrs );
    }
  }


  FT_LOCAL_DEF( FT_Error )
  cff_font_load( FT_Stream  stream,
                 FT_Int     face_index,
                 CFF_Font   font )
  {
    static const FT_Frame_Field  cff_header_fields[] =
    {
#undef  FT_STRUCTURE
#define FT_STRUCTURE  CFF_FontRec

      FT_FRAME_START( 4 ),
        FT_FRAME_BYTE( version_major ),
        FT_FRAME_BYTE( version_minor ),
        FT_FRAME_BYTE( header_size ),
        FT_FRAME_BYTE( absolute_offsize ),
      FT_FRAME_END
    };

    FT_Error         error;
    FT_Memory        memory = stream->memory;
    FT_ULong         base_offset;
    CFF_FontRecDict  dict;


    FT_ZERO( font );

    font->stream = stream;
    font->memory = memory;
    dict         = &font->top_font.font_dict;
    base_offset  = FT_STREAM_POS();

    /* read CFF font header */
    if ( FT_STREAM_READ_FIELDS( cff_header_fields, font ) )
      goto Exit;

    /* check format */
    if ( font->version_major   != 1 ||
         font->header_size      < 4 ||
         font->absolute_offsize > 4 )
    {
      FT_TRACE2(( "[not a CFF font header!]\n" ));
      error = CFF_Err_Unknown_File_Format;
      goto Exit;
    }

    /* skip the rest of the header */
    if ( FT_STREAM_SKIP( font->header_size - 4 ) )
      goto Exit;

    /* read the name, top dict, string and global subrs index */
    if ( FT_SET_ERROR( cff_new_index( &font->name_index,         stream, 0 )) ||
         FT_SET_ERROR( cff_new_index( &font->font_dict_index,    stream, 0 )) ||
         FT_SET_ERROR( cff_new_index( &font->string_index,       stream, 0 )) ||
         FT_SET_ERROR( cff_new_index( &font->global_subrs_index, stream, 1 )) )
      goto Exit;

    /* well, we don't really forget the `disabled' fonts... */
    font->num_faces = font->name_index.count;
    if ( face_index >= (FT_Int)font->num_faces )
    {
      FT_ERROR(( "cff_font_load: incorrect face index = %d\n",
                 face_index ));
      error = CFF_Err_Invalid_Argument;
    }

    /* in case of a font format check, simply exit now */
    if ( face_index < 0 )
      goto Exit;

    /* now, parse the top-level font dictionary */
    error = cff_subfont_load( &font->top_font,
                              &font->font_dict_index,
                              face_index,
                              stream,
                              base_offset );
    if ( error )
      goto Exit;

    if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) )
      goto Exit;

    error = cff_new_index( &font->charstrings_index, stream, 0 );
    if ( error )
      goto Exit;

    /* now, check for a CID font */
    if ( dict->cid_registry != 0xFFFFU )
    {
      CFF_IndexRec  fd_index;
      CFF_SubFont   sub;
      FT_UInt       idx;


      /* this is a CID-keyed font, we must now allocate a table of */
      /* sub-fonts, then load each of them separately              */
      if ( FT_STREAM_SEEK( base_offset + dict->cid_fd_array_offset ) )
        goto Exit;

      error = cff_new_index( &fd_index, stream, 0 );
      if ( error )
        goto Exit;

      if ( fd_index.count > CFF_MAX_CID_FONTS )
      {
        FT_ERROR(( "cff_font_load: FD array too large in CID font\n" ));
        goto Fail_CID;
      }

      /* allocate & read each font dict independently */
      font->num_subfonts = fd_index.count;
      if ( FT_NEW_ARRAY( sub, fd_index.count ) )
        goto Fail_CID;

      /* set up pointer table */
      for ( idx = 0; idx < fd_index.count; idx++ )
        font->subfonts[idx] = sub + idx;

      /* now load each subfont independently */
      for ( idx = 0; idx < fd_index.count; idx++ )
      {
        sub = font->subfonts[idx];
        error = cff_subfont_load( sub, &fd_index, idx,
                                  stream, base_offset );
        if ( error )
          goto Fail_CID;
      }

      /* now load the FD Select array */
      error = CFF_Load_FD_Select( &font->fd_select,
                                  font->charstrings_index.count,
                                  stream,
                                  base_offset + dict->cid_fd_select_offset );

    Fail_CID:
      cff_done_index( &fd_index );

      if ( error )
        goto Exit;
    }
    else
      font->num_subfonts = 0;

    /* read the charstrings index now */
    if ( dict->charstrings_offset == 0 )
    {
      FT_ERROR(( "cff_font_load: no charstrings offset!\n" ));
      error = CFF_Err_Unknown_File_Format;
      goto Exit;
    }

    /* explicit the global subrs */
    font->num_global_subrs = font->global_subrs_index.count;
    font->num_glyphs       = font->charstrings_index.count;

    error = cff_index_get_pointers( &font->global_subrs_index,
                                    &font->global_subrs ) ;

    if ( error )
      goto Exit;

    /* read the Charset and Encoding tables if available */
    if ( font->num_glyphs > 0 )
    {
      FT_Bool  invert = FT_BOOL( dict->cid_registry != 0xFFFFU );


      error = cff_charset_load( &font->charset, font->num_glyphs, stream,
                                base_offset, dict->charset_offset, invert );
      if ( error )
        goto Exit;

      /* CID-keyed CFFs don't have an encoding */
      if ( dict->cid_registry == 0xFFFFU )
      {
        error = cff_encoding_load( &font->encoding,
                                   &font->charset,
                                   font->num_glyphs,
                                   stream,
                                   base_offset,
                                   dict->encoding_offset );
        if ( error )
          goto Exit;
      }
      else
        /* CID-keyed fonts only need CIDs */
        FT_FREE( font->charset.sids );
    }

    /* get the font name (/CIDFontName for CID-keyed fonts, */
    /* /FontName otherwise)                                 */
    font->font_name = cff_index_get_name( &font->name_index, face_index );

  Exit:
    return error;
  }


  FT_LOCAL_DEF( void )
  cff_font_done( CFF_Font  font )
  {
    FT_Memory  memory = font->memory;
    FT_UInt    idx;


    cff_done_index( &font->global_subrs_index );
    cff_done_index( &font->string_index );
    cff_done_index( &font->font_dict_index );
    cff_done_index( &font->name_index );
    cff_done_index( &font->charstrings_index );

    /* release font dictionaries, but only if working with */
    /* a CID keyed CFF font                                */
    if ( font->num_subfonts > 0 )
    {
      for ( idx = 0; idx < font->num_subfonts; idx++ )
        cff_subfont_done( memory, font->subfonts[idx] );
    }

    cff_encoding_done( &font->encoding );
    cff_charset_done( &font->charset, font->stream );

    cff_subfont_done( memory, &font->top_font );

    CFF_Done_FD_Select( &font->fd_select, font->stream );

    FT_FREE( font->global_subrs );
    FT_FREE( font->font_name );
  }


/* END */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久亚洲欧洲日产国码αv| 亚洲另类色综合网站| 国产精品丝袜91| 亚洲电影激情视频网站| www.成人网.com| 欧美成人一区二区三区在线观看| 亚洲精品第1页| 成人激情免费视频| 欧美成人精品1314www| 亚洲国产va精品久久久不卡综合 | 久久香蕉国产线看观看99| 一区二区三区中文在线| 粉嫩高潮美女一区二区三区| 日韩三级电影网址| 日韩高清在线观看| 欧美日韩美女一区二区| 亚洲美女一区二区三区| 成人不卡免费av| 久久久国产一区二区三区四区小说| 日韩电影在线观看电影| 欧美日韩在线不卡| 亚洲一区在线观看免费 | 欧美电影一区二区| 一区二区三区四区在线免费观看| 成人精品一区二区三区四区| 久久久精品综合| 久久99久久99小草精品免视看| 精品视频资源站| 一区在线中文字幕| 91视视频在线观看入口直接观看www | 午夜精品久久久久影视| 91色乱码一区二区三区| 亚洲色图制服丝袜| 97se狠狠狠综合亚洲狠狠| 精品sm捆绑视频| 日本色综合中文字幕| 91麻豆精品国产91久久久久久| 日韩国产精品久久| 欧美一级黄色片| 久久精品久久久精品美女| 日韩一区二区电影网| 理论电影国产精品| 久久久久久久久久久久久久久99| 国产九九视频一区二区三区| 国产日韩精品久久久| 不卡大黄网站免费看| 亚洲欧美色图小说| 欧美二区三区的天堂| 精品一区二区三区影院在线午夜 | 在线观看成人免费视频| 亚洲成人第一页| 日韩视频在线永久播放| 国产成人99久久亚洲综合精品| 久久精品视频免费观看| 99精品久久免费看蜜臀剧情介绍| 一区二区理论电影在线观看| 欧美精品在线视频| 国产美女在线精品| 亚洲色欲色欲www| 欧美一级日韩免费不卡| 丰满亚洲少妇av| 亚洲国产精品视频| 精品播放一区二区| 在线观看不卡视频| 国产一区二区福利视频| 一区二区三区四区视频精品免费| 91精品久久久久久蜜臀| 大白屁股一区二区视频| 亚洲影院免费观看| 国产色综合一区| 欧美精品tushy高清| 国产精品1024久久| 日韩二区在线观看| 亚洲欧美日韩国产综合在线| 日韩丝袜情趣美女图片| 色吊一区二区三区| 国产精品白丝av| 视频一区在线播放| 日韩毛片高清在线播放| 久久午夜电影网| 欧美群妇大交群的观看方式| eeuss鲁一区二区三区| 美女脱光内衣内裤视频久久网站| 亚洲女同女同女同女同女同69| 久久综合色播五月| 91精品在线免费| 色婷婷狠狠综合| 国产99久久精品| 久久精品国产一区二区三区免费看 | 911精品国产一区二区在线| 成人免费看片app下载| 婷婷国产在线综合| 一区二区三区 在线观看视频| 国产日韩亚洲欧美综合| 欧美大片在线观看一区| 欧美高清dvd| 欧美日韩高清影院| 欧美在线观看视频一区二区| 99视频超级精品| 高清免费成人av| 国产一区视频在线看| 麻豆精品在线播放| 日韩精品电影在线| 日韩成人伦理电影在线观看| 亚洲国产精品影院| 亚洲精品国产精品乱码不99| 亚洲欧美另类久久久精品2019| 中文一区在线播放| 国产日韩亚洲欧美综合| 国产欧美日韩综合| 国产精品久久久久久久浪潮网站| 久久久久久电影| 久久久久久麻豆| 国产欧美日韩在线看| 久久九九全国免费| 国产亚洲va综合人人澡精品| 久久亚洲精华国产精华液| 欧美精品一区二区精品网| 久久伊人中文字幕| 国产欧美视频一区二区三区| 国产香蕉久久精品综合网| 久久久国产精品不卡| 国产精品网站导航| 亚洲欧洲日韩在线| 亚洲激情第一区| 亚洲成av人片一区二区三区| 五月天一区二区三区| 久久电影网电视剧免费观看| 国模娜娜一区二区三区| 成人免费视频播放| 欧美最猛性xxxxx直播| 欧美区视频在线观看| 欧美mv和日韩mv的网站| 国产亚洲综合色| 自拍偷拍国产精品| 性欧美大战久久久久久久久| 免费黄网站欧美| 成人性生交大片免费| 在线观看亚洲成人| 精品久久久久久无| 亚洲欧洲国产专区| 日韩在线a电影| 风间由美一区二区三区在线观看 | 韩国一区二区三区| av一区二区不卡| 色94色欧美sute亚洲线路一ni| 欧美一区二区三区在线观看| 久久伊人蜜桃av一区二区| 亚洲欧美国产毛片在线| 久久97超碰国产精品超碰| 成人精品视频一区二区三区尤物| 91成人免费网站| 26uuu国产在线精品一区二区| 中文字幕在线免费不卡| 91麻豆swag| 日韩亚洲欧美中文三级| 日韩一区中文字幕| 麻豆成人91精品二区三区| 99久久精品免费| 欧美成人一级视频| 一区二区三区精品在线观看| 国精品**一区二区三区在线蜜桃| 在线区一区二视频| 国产欧美一区二区精品婷婷| 天天综合天天综合色| 一本久久a久久精品亚洲| 精品国产乱码久久久久久夜甘婷婷| 亚洲免费观看高清完整版在线| 黑人巨大精品欧美一区| 欧美高清视频一二三区 | 欧美人成免费网站| 国产精品传媒视频| 九色综合狠狠综合久久| 欧美日韩一区二区三区四区 | 成人欧美一区二区三区| 久久99国产精品麻豆| 717成人午夜免费福利电影| 一区二区在线观看视频在线观看| 国产麻豆精品一区二区| 欧美一区二区性放荡片| 亚洲国产视频一区| 91美女片黄在线| 国产精品美女www爽爽爽| 国产伦精一区二区三区| 日韩精品一区二区在线| 青娱乐精品视频在线| 欧美顶级少妇做爰| 午夜精品福利视频网站| 欧美日韩一区二区三区在线| 亚洲裸体xxx| 色婷婷国产精品综合在线观看| 最新国产精品久久精品| 国产成人免费在线观看| 久久久久久综合| 国产一区二区三区电影在线观看| 日韩一区二区免费视频| 另类欧美日韩国产在线| 日韩欧美www| 国产在线日韩欧美| 久久精品亚洲精品国产欧美kt∨ |