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

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

?? t42parse.c

?? 智能設備中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] ) )

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久伊99综合婷婷久久伊| 2欧美一区二区三区在线观看视频| 欧美一级片在线| 亚洲男人的天堂网| 欧美日韩一区三区| 日韩在线a电影| 国产日产亚洲精品系列| 欧美日韩中字一区| 五月天婷婷综合| 日韩精品一区二区三区swag| 日韩在线观看一区二区| 色国产精品一区在线观看| 久久亚洲精精品中文字幕早川悠里| 国产精品久久国产精麻豆99网站| 精品写真视频在线观看| 亚洲丝袜美腿综合| 亚洲乱码国产乱码精品精可以看| 国产精品久久久久久妇女6080| 在线观看亚洲成人| 久久精品国产亚洲aⅴ| 亚洲乱码国产乱码精品精的特点| 欧美在线观看一区二区| 视频一区在线视频| 国产婷婷色一区二区三区在线| 91精品麻豆日日躁夜夜躁| 免费观看在线综合色| 亚洲视频 欧洲视频| 久久久欧美精品sm网站| 欧美二区乱c少妇| 色美美综合视频| 99久久久免费精品国产一区二区| 亚洲综合丁香婷婷六月香| 国产视频911| 国产亚洲一本大道中文在线| 欧美丝袜自拍制服另类| 色婷婷久久99综合精品jk白丝| 国产真实乱对白精彩久久| 精品午夜一区二区三区在线观看| 国内成人精品2018免费看| 亚洲精品国产精品乱码不99 | 欧美tickle裸体挠脚心vk| 亚洲国产精品久久人人爱| 久久视频一区二区| 亚洲视频综合在线| 在线观看国产日韩| 韩国在线一区二区| 精品少妇一区二区三区日产乱码 | 亚洲第一久久影院| 欧美日韩免费高清一区色橹橹| 国产精品人妖ts系列视频| 日韩一区二区三区观看| 日韩一区二区视频| 国产网站一区二区三区| 2023国产一二三区日本精品2022| 精品国产在天天线2019| 无码av免费一区二区三区试看| 日韩av一区二区三区四区| 欧美午夜宅男影院| 91麻豆国产香蕉久久精品| 欧美成人三级在线| 国产一区二区三区久久久| 精品国产一区二区国模嫣然| 国产一区二区在线观看免费| 久久人人爽爽爽人久久久| 亚洲国产精品久久人人爱蜜臀| 蜜桃视频一区二区| 欧美日韩亚洲国产综合| 欧美zozo另类异族| 五月婷婷综合激情| 国产成人午夜99999| 成人激情电影免费在线观看| 制服丝袜av成人在线看| 欧美aaaaa成人免费观看视频| 欧美成人免费网站| 婷婷久久综合九色综合伊人色| 国产制服丝袜一区| 亚洲精品视频在线| 亚洲精品在线免费播放| 91亚洲国产成人精品一区二三| 五月天精品一区二区三区| 亚洲电影在线免费观看| 51精品视频一区二区三区| 亚洲人亚洲人成电影网站色| 99九九99九九九视频精品| 免费看日韩精品| 一区二区三区中文字幕在线观看| 欧美成va人片在线观看| 久久综合久久综合久久| 色999日韩国产欧美一区二区| 水野朝阳av一区二区三区| 国产精品卡一卡二| 欧美电影免费提供在线观看| 在线免费亚洲电影| 成人a免费在线看| 国产呦萝稀缺另类资源| 图片区小说区区亚洲影院| 一卡二卡三卡日韩欧美| 中文字幕制服丝袜成人av| 久久久亚洲高清| 日韩精品专区在线影院重磅| 欧美日韩久久一区| 色久优优欧美色久优优| www.日韩大片| 成人精品国产一区二区4080| 国产精品主播直播| 激情综合亚洲精品| 久久成人免费网站| 麻豆精品视频在线观看| 日本欧美一区二区| 日本伊人午夜精品| 日本伊人精品一区二区三区观看方式| 夜夜精品视频一区二区 | 不卡的电影网站| 丁香激情综合国产| 国产精品影音先锋| 国产成人亚洲综合a∨猫咪| 久久99精品视频| 国产一区二区三区黄视频| 精品在线亚洲视频| 韩国午夜理伦三级不卡影院| 麻豆成人久久精品二区三区小说| 天堂午夜影视日韩欧美一区二区| 亚洲国产综合91精品麻豆| 夜夜精品视频一区二区| 香蕉久久夜色精品国产使用方法| 亚洲妇女屁股眼交7| 亚洲chinese男男1069| 午夜久久久久久久久久一区二区| 日韩中文字幕麻豆| 久久er精品视频| 国产91丝袜在线播放| 91在线观看高清| 欧美伊人精品成人久久综合97| 欧美日韩一区高清| 欧美大片一区二区| 中文无字幕一区二区三区 | 91理论电影在线观看| 日本高清视频一区二区| 91精品一区二区三区在线观看| 精品久久人人做人人爽| 国产精品乱码久久久久久| 一区二区三区精密机械公司| 五月激情综合网| 国内精品伊人久久久久av影院| 成人午夜短视频| 欧美日韩视频不卡| 精品国产亚洲在线| 亚洲色大成网站www久久九九| 日韩国产欧美在线视频| 国产精品综合在线视频| 在线日韩av片| 久久一二三国产| 一区二区在线免费观看| 麻豆成人av在线| 一本到不卡精品视频在线观看| 日韩视频免费直播| 国产精品美女久久久久久2018 | 免费观看久久久4p| 国产一区二区三区四区在线观看| 亚洲三级在线播放| 日韩精品电影在线| 不卡欧美aaaaa| 欧美一区二区播放| 亚洲日本在线观看| ...xxx性欧美| 久久精品国产99| 蜜臀av性久久久久蜜臀aⅴ| 成人污污视频在线观看| 欧美精品高清视频| 中文字幕中文字幕在线一区| 蜜臀av一区二区| 欧美在线观看禁18| 国产人久久人人人人爽| 男男成人高潮片免费网站| 91麻豆国产精品久久| 久久精品无码一区二区三区| 日韩精品一二三区| 欧洲中文字幕精品| 中文字幕一区二区三区av| 久久99精品国产麻豆婷婷 | 亚洲少妇30p| 精品欧美乱码久久久久久| 丰满少妇久久久久久久| 亚洲午夜影视影院在线观看| 日韩一区二区三区在线| 精品日韩一区二区三区| 午夜亚洲福利老司机| 色哟哟国产精品| 国产精品福利一区二区三区| 国产综合一区二区| 日韩精品一区国产麻豆| 性做久久久久久| 欧美性大战久久久久久久蜜臀| 国产精品欧美一区喷水| 国产美女久久久久| 久久久蜜桃精品| 韩国精品久久久| 精品国产一区二区三区久久影院 | 色综合天天综合狠狠| 一色屋精品亚洲香蕉网站|