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

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

?? t42parse.c

?? 智能設(shè)備中PDF閱讀器的源碼!用于windows mobile2003或者WM5以上
?? C
?? 第 1 頁 / 共 3 頁
字號:
/***************************************************************************/
/*                                                                         */
/*  t42parse.c                                                             */
/*                                                                         */
/*    Type 42 font parser (body).                                          */
/*                                                                         */
/*  Copyright 2002, 2003, 2004, 2005, 2006 by Roberto Alameda.             */
/*                                                                         */
/*  This file is part of the FreeType project, and may only be used,       */
/*  modified, and distributed under the terms of the FreeType project      */
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
/*  this file you indicate that you have read the license and              */
/*  understand and accept it fully.                                        */
/*                                                                         */
/***************************************************************************/


#include "t42parse.h"
#include "t42error.h"
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_LIST_H
#include FT_INTERNAL_POSTSCRIPT_AUX_H


  /*************************************************************************/
  /*                                                                       */
  /* The macro FT_COMPONENT is used in trace mode.  It is an implicit      */
  /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log  */
  /* messages during execution.                                            */
  /*                                                                       */
#undef  FT_COMPONENT
#define FT_COMPONENT  trace_t42


  static void
  t42_parse_font_matrix( T42_Face    face,
                         T42_Loader  loader );
  static void
  t42_parse_encoding( T42_Face    face,
                      T42_Loader  loader );

  static void
  t42_parse_charstrings( T42_Face    face,
                         T42_Loader  loader );

  static void
  t42_parse_sfnts( T42_Face    face,
                   T42_Loader  loader );


  static const
  T1_FieldRec  t42_keywords[] = {

#undef  FT_STRUCTURE
#define FT_STRUCTURE  T1_FontInfo
#undef  T1CODE
#define T1CODE        T1_FIELD_LOCATION_FONT_INFO

    T1_FIELD_STRING( "version",            version )
    T1_FIELD_STRING( "Notice",             notice )
    T1_FIELD_STRING( "FullName",           full_name )
    T1_FIELD_STRING( "FamilyName",         family_name )
    T1_FIELD_STRING( "Weight",             weight )
    T1_FIELD_NUM   ( "ItalicAngle",        italic_angle )
    T1_FIELD_BOOL  ( "isFixedPitch",       is_fixed_pitch )
    T1_FIELD_NUM   ( "UnderlinePosition",  underline_position )
    T1_FIELD_NUM   ( "UnderlineThickness", underline_thickness )

#undef  FT_STRUCTURE
#define FT_STRUCTURE  T1_FontRec
#undef  T1CODE
#define T1CODE        T1_FIELD_LOCATION_FONT_DICT

    T1_FIELD_KEY  ( "FontName",    font_name )
    T1_FIELD_NUM  ( "PaintType",   paint_type )
    T1_FIELD_NUM  ( "FontType",    font_type )
    T1_FIELD_FIXED( "StrokeWidth", stroke_width )

#undef  FT_STRUCTURE
#define FT_STRUCTURE  FT_BBox
#undef  T1CODE
#define T1CODE        T1_FIELD_LOCATION_BBOX

    T1_FIELD_BBOX("FontBBox", xMin )

    T1_FIELD_CALLBACK( "FontMatrix",  t42_parse_font_matrix )
    T1_FIELD_CALLBACK( "Encoding",    t42_parse_encoding )
    T1_FIELD_CALLBACK( "CharStrings", t42_parse_charstrings )
    T1_FIELD_CALLBACK( "sfnts",       t42_parse_sfnts )

    { 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
  };


#define T1_Add_Table( p, i, o, l )  (p)->funcs.add( (p), i, o, l )
#define T1_Done_Table( p )          \
          do                        \
          {                         \
            if ( (p)->funcs.done )  \
              (p)->funcs.done( p ); \
          } while ( 0 )
#define T1_Release_Table( p )          \
          do                           \
          {                            \
            if ( (p)->funcs.release )  \
              (p)->funcs.release( p ); \
          } while ( 0 )

#define T1_Skip_Spaces( p )    (p)->root.funcs.skip_spaces( &(p)->root )
#define T1_Skip_PS_Token( p )  (p)->root.funcs.skip_PS_token( &(p)->root )

#define T1_ToInt( p )                          \
          (p)->root.funcs.to_int( &(p)->root )
#define T1_ToBytes( p, b, m, n, d )                          \
          (p)->root.funcs.to_bytes( &(p)->root, b, m, n, d )

#define T1_ToFixedArray( p, m, f, t )                           \
          (p)->root.funcs.to_fixed_array( &(p)->root, m, f, t )
#define T1_ToToken( p, t )                          \
          (p)->root.funcs.to_token( &(p)->root, t )

#define T1_Load_Field( p, f, o, m, pf )                         \
          (p)->root.funcs.load_field( &(p)->root, f, o, m, pf )
#define T1_Load_Field_Table( p, f, o, m, pf )                         \
          (p)->root.funcs.load_field_table( &(p)->root, f, o, m, pf )


  /********************* Parsing Functions ******************/

  FT_LOCAL_DEF( FT_Error )
  t42_parser_init( T42_Parser     parser,
                   FT_Stream      stream,
                   FT_Memory      memory,
                   PSAux_Service  psaux )
  {
    FT_Error  error = T42_Err_Ok;
    FT_Long   size;


    psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );

    parser->stream    = stream;
    parser->base_len  = 0;
    parser->base_dict = 0;
    parser->in_memory = 0;

    /*******************************************************************/
    /*                                                                 */
    /* Here a short summary of what is going on:                       */
    /*                                                                 */
    /*   When creating a new Type 42 parser, we try to locate and load */
    /*   the base dictionary, loading the whole font into memory.      */
    /*                                                                 */
    /*   When `loading' the base dictionary, we only set up pointers   */
    /*   in the case of a memory-based stream.  Otherwise, we allocate */
    /*   and load the base dictionary in it.                           */
    /*                                                                 */
    /*   parser->in_memory is set if we have a memory stream.          */
    /*                                                                 */

    if ( FT_STREAM_SEEK( 0L ) ||
         FT_FRAME_ENTER( 17 ) )
      goto Exit;

    if ( ft_memcmp( stream->cursor, "%!PS-TrueTypeFont", 17 ) != 0 )
    {
      FT_TRACE2(( "not a Type42 font\n" ));
      error = T42_Err_Unknown_File_Format;
    }

    FT_FRAME_EXIT();

    if ( error || FT_STREAM_SEEK( 0 ) )
      goto Exit;

    size = stream->size;

    /* now, try to load `size' bytes of the `base' dictionary we */
    /* found previously                                          */

    /* if it is a memory-based resource, set up pointers */
    if ( !stream->read )
    {
      parser->base_dict = (FT_Byte*)stream->base + stream->pos;
      parser->base_len  = size;
      parser->in_memory = 1;

      /* check that the `size' field is valid */
      if ( FT_STREAM_SKIP( size ) )
        goto Exit;
    }
    else
    {
      /* read segment in memory */
      if ( FT_ALLOC( parser->base_dict, size )       ||
           FT_STREAM_READ( parser->base_dict, size ) )
        goto Exit;

      parser->base_len = size;
    }

    parser->root.base   = parser->base_dict;
    parser->root.cursor = parser->base_dict;
    parser->root.limit  = parser->root.cursor + parser->base_len;

  Exit:
    if ( error && !parser->in_memory )
      FT_FREE( parser->base_dict );

    return error;
  }


  FT_LOCAL_DEF( void )
  t42_parser_done( T42_Parser  parser )
  {
    FT_Memory  memory = parser->root.memory;


    /* free the base dictionary only when we have a disk stream */
    if ( !parser->in_memory )
      FT_FREE( parser->base_dict );

    parser->root.funcs.done( &parser->root );
  }


  static int
  t42_is_space( FT_Byte  c )
  {
    return ( c == ' '  || c == '\t'              ||
             c == '\r' || c == '\n' || c == '\f' ||
             c == '\0'                           );
  }


  static void
  t42_parse_font_matrix( T42_Face    face,
                         T42_Loader  loader )
  {
    T42_Parser  parser = &loader->parser;
    FT_Matrix*  matrix = &face->type1.font_matrix;
    FT_Vector*  offset = &face->type1.font_offset;
    FT_Face     root   = (FT_Face)&face->root;
    FT_Fixed    temp[6];
    FT_Fixed    temp_scale;


    (void)T1_ToFixedArray( parser, 6, temp, 3 );

    temp_scale = FT_ABS( temp[3] );

    /* Set Units per EM based on FontMatrix values.  We set the value to */
    /* 1000 / temp_scale, because temp_scale was already multiplied by   */
    /* 1000 (in t1_tofixed, from psobjs.c).                              */

    root->units_per_EM = (FT_UShort)( FT_DivFix( 1000 * 0x10000L,
                                                 temp_scale ) >> 16 );

    /* we need to scale the values by 1.0/temp_scale */
    if ( temp_scale != 0x10000L ) {
      temp[0] = FT_DivFix( temp[0], temp_scale );
      temp[1] = FT_DivFix( temp[1], temp_scale );
      temp[2] = FT_DivFix( temp[2], temp_scale );
      temp[4] = FT_DivFix( temp[4], temp_scale );
      temp[5] = FT_DivFix( temp[5], temp_scale );
      temp[3] = 0x10000L;
    }

    matrix->xx = temp[0];
    matrix->yx = temp[1];
    matrix->xy = temp[2];
    matrix->yy = temp[3];

    /* note that the offsets must be expressed in integer font units */
    offset->x = temp[4] >> 16;
    offset->y = temp[5] >> 16;
  }


  static void
  t42_parse_encoding( T42_Face    face,
                      T42_Loader  loader )
  {
    T42_Parser  parser = &loader->parser;
    FT_Byte*    cur;
    FT_Byte*    limit  = parser->root.limit;

    PSAux_Service  psaux  = (PSAux_Service)face->psaux;


    T1_Skip_Spaces( parser );
    cur = parser->root.cursor;
    if ( cur >= limit )
    {
      FT_ERROR(( "t42_parse_encoding: out of bounds!\n" ));
      parser->root.error = T42_Err_Invalid_File_Format;
      return;
    }

    /* if we have a number or `[', the encoding is an array, */
    /* and we must load it now                               */
    if ( ft_isdigit( *cur ) || *cur == '[' )
    {
      T1_Encoding  encode          = &face->type1.encoding;
      FT_UInt      count, n;
      PS_Table     char_table      = &loader->encoding_table;
      FT_Memory    memory          = parser->root.memory;
      FT_Error     error;
      FT_Bool      only_immediates = 0;


      /* read the number of entries in the encoding; should be 256 */
      if ( *cur == '[' )
      {
        count           = 256;
        only_immediates = 1;
        parser->root.cursor++;
      }
      else
        count = (FT_UInt)T1_ToInt( parser );

      T1_Skip_Spaces( parser );
      if ( parser->root.cursor >= limit )
        return;

      /* we use a T1_Table to store our charnames */
      loader->num_chars = encode->num_chars = count;
      if ( FT_NEW_ARRAY( encode->char_index, count )     ||
           FT_NEW_ARRAY( encode->char_name,  count )     ||
           FT_SET_ERROR( psaux->ps_table_funcs->init(
                           char_table, count, memory ) ) )
      {
        parser->root.error = error;
        return;
      }

      /* We need to `zero' out encoding_table.elements */
      for ( n = 0; n < count; n++ )
      {
        char*  notdef = (char *)".notdef";


        T1_Add_Table( char_table, n, notdef, 8 );
      }

      /* Now we need to read records of the form                */
      /*                                                        */
      /*   ... charcode /charname ...                           */
      /*                                                        */
      /* for each entry in our table.                           */
      /*                                                        */
      /* We simply look for a number followed by an immediate   */
      /* name.  Note that this ignores correctly the sequence   */
      /* that is often seen in type42 fonts:                    */
      /*                                                        */
      /*   0 1 255 { 1 index exch /.notdef put } for dup        */
      /*                                                        */
      /* used to clean the encoding array before anything else. */
      /*                                                        */
      /* Alternatively, if the array is directly given as       */
      /*                                                        */
      /*   /Encoding [ ... ]                                    */
      /*                                                        */
      /* we only read immediates.                               */

      n = 0;
      T1_Skip_Spaces( parser );

      while ( parser->root.cursor < limit )
      {
        cur = parser->root.cursor;

        /* we stop when we encounter `def' or `]' */
        if ( *cur == 'd' && cur + 3 < limit )
        {
          if ( cur[1] == 'e'          &&
               cur[2] == 'f'          &&
               t42_is_space( cur[3] ) )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产一区二区三区蜜臀 | 欧美理论片在线| 一区二区三区免费观看| 一本久久综合亚洲鲁鲁五月天| 国产婷婷色一区二区三区四区| 国产成人自拍网| 国产精品天天看| 欧美亚洲图片小说| 久久成人免费日本黄色| 中文字幕av一区二区三区高| 91免费在线看| 免费在线观看不卡| 亚洲丝袜精品丝袜在线| 在线一区二区观看| 韩国成人在线视频| 中文字幕在线不卡视频| 欧美美女一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 日韩一区二区在线免费观看| 美女mm1313爽爽久久久蜜臀| 亚洲视频网在线直播| 精品国产乱码久久| 91.成人天堂一区| 播五月开心婷婷综合| 美女一区二区久久| 亚洲午夜羞羞片| 亚洲精品中文字幕乱码三区| 精品国产91洋老外米糕| 欧美日产国产精品| 在线观看精品一区| 色屁屁一区二区| 国产精一区二区三区| 午夜电影网一区| 一区二区三区四区视频精品免费 | 久久男人中文字幕资源站| 欧美日韩国产一二三| 国模套图日韩精品一区二区| 亚洲免费电影在线| 中文字幕巨乱亚洲| 久久午夜电影网| 国产欧美视频在线观看| 久久久另类综合| 中文字幕av不卡| 亚洲精品成a人| 日韩电影在线一区| 国产精品亚洲综合一区在线观看| 国产美女视频一区| 99视频在线精品| 色呦呦网站一区| 日韩三级电影网址| 中文字幕中文字幕一区二区| 一区二区国产盗摄色噜噜| 亚洲影院免费观看| 国产一区二区三区免费播放| 国产成人综合视频| 在线成人午夜影院| 日韩欧美综合在线| 久久九九久久九九| 首页综合国产亚洲丝袜| 韩国av一区二区三区在线观看| 波多野结衣中文字幕一区 | 精品电影一区二区三区| 日韩一区欧美小说| 国产麻豆视频一区二区| 91精品欧美综合在线观看最新| 久久久午夜精品| 麻豆精品一二三| 91精品啪在线观看国产60岁| 亚洲人成小说网站色在线| 精品亚洲欧美一区| 日韩一级视频免费观看在线| 亚洲一区视频在线观看视频| caoporen国产精品视频| 久久久无码精品亚洲日韩按摩| 亚洲成人久久影院| 成人美女视频在线看| 久久无码av三级| 激情图片小说一区| 精品国产成人系列| 韩国成人福利片在线播放| 欧美成人性战久久| 国精产品一区一区三区mba视频 | 精品国产三级a在线观看| 日韩在线一区二区三区| 精品国产91久久久久久久妲己| 精品国产一区a| 久久精品人人做人人爽人人| 国产日韩视频一区二区三区| 亚洲视频一二区| 日韩电影在线看| www.亚洲免费av| 欧美一级xxx| 国产一区二区精品久久| 久久久久免费观看| 色欧美乱欧美15图片| 亚洲成国产人片在线观看| 久久久久久综合| 欧美综合一区二区三区| 国内外成人在线| 亚洲三级免费电影| 久久久久久久久97黄色工厂| 欧美日韩一区二区三区在线看| 精品一区中文字幕| 午夜激情综合网| 亚洲欧美偷拍卡通变态| 精品国产欧美一区二区| 日本久久电影网| 盗摄精品av一区二区三区| 麻豆国产欧美一区二区三区| 日精品一区二区三区| 国产精品网站一区| 欧美激情一区二区三区| 久久亚洲一区二区三区明星换脸| 欧美日韩一区高清| 欧美性大战久久久久久久 | 一区二区三区产品免费精品久久75| 欧美成人高清电影在线| 欧美精品三级在线观看| 欧美日韩国产大片| 欧美日韩精品是欧美日韩精品| 欧美在线观看视频一区二区| 91农村精品一区二区在线| 在线欧美日韩国产| 日本高清视频一区二区| 欧美色图第一页| 91精品国产欧美一区二区成人| 欧美久久久影院| 欧美成人一区二区三区在线观看| 日韩欧美电影一区| 国产精品水嫩水嫩| 亚洲免费在线视频| 日韩成人午夜电影| 国产精品一二三四| 欧美这里有精品| 欧美一级黄色大片| 国产精品美女久久福利网站 | 国产成人av电影在线播放| 一区二区欧美精品| 久草这里只有精品视频| 成人晚上爱看视频| 欧美另类久久久品| 亚洲青青青在线视频| 久久精品久久久精品美女| 成人激情小说乱人伦| 日韩午夜激情av| 亚洲一区二区av在线| 成人精品鲁一区一区二区| 欧美日本在线播放| 亚洲精品国产第一综合99久久| 麻豆精品新av中文字幕| 精品视频在线视频| 亚洲综合区在线| 欧美性色黄大片手机版| 亚洲免费观看高清在线观看| 国产mv日韩mv欧美| 国产欧美一区二区精品仙草咪 | 日本女人一区二区三区| 欧美日韩在线电影| 亚洲国产aⅴ成人精品无吗| 99国产精品国产精品久久| 国产女同互慰高潮91漫画| 美日韩一区二区三区| 色综合婷婷久久| 亚洲午夜三级在线| 91久久线看在观草草青青| 亚洲制服丝袜av| 欧美性猛交xxxx乱大交退制版| 一区二区三区日韩在线观看| 欧美亚洲一区二区在线观看| 亚洲国产综合人成综合网站| 欧美精品在线视频| 美女视频黄免费的久久| 亚洲精选免费视频| 337p亚洲精品色噜噜噜| 久久99国产精品免费| 国产精品传媒视频| 欧美亚洲一区二区三区四区| 免费精品视频在线| 中文字幕精品一区二区三区精品| 91丨九色丨国产丨porny| 美女精品自拍一二三四| 亚洲人成影院在线观看| 欧美成人午夜电影| 欧美性xxxxxx少妇| 成人国产电影网| 久久99国产精品久久99果冻传媒| 中文字幕av一区二区三区| 欧美亚洲丝袜传媒另类| 99视频精品在线| 午夜精品久久久久久| 26uuu久久天堂性欧美| 欧美色综合久久| 91美女在线观看| 成人黄色小视频| 国产 欧美在线| 国精品**一区二区三区在线蜜桃| 日本不卡的三区四区五区| 午夜伦理一区二区| 亚洲va欧美va人人爽午夜| 亚洲免费av网站|