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

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

?? ttsbit.c

?? 智能設備中PDF閱讀器的源碼!用于windows mobile2003或者WM5以上
?? C
?? 第 1 頁 / 共 4 頁
字號:
/***************************************************************************/
/*                                                                         */
/*  ttsbit.c                                                               */
/*                                                                         */
/*    TrueType and OpenType embedded bitmap support (body).                */
/*                                                                         */
/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
/*                                                                         */
/*  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 <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H

  /*
   *  Alas, the memory-optimized sbit loader can't be used when implementing
   *  the `old internals' hack
   */
#if defined FT_OPTIMIZE_MEMORY && !defined FT_CONFIG_OPTION_OLD_INTERNALS

#include "ttsbit0.c"

#else /* !OPTIMIZE_MEMORY || OLD_INTERNALS */

#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_STREAM_H
#include FT_TRUETYPE_TAGS_H
#include "ttsbit.h"

#include "sferrors.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_ttsbit


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    blit_sbit                                                          */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Blits a bitmap from an input stream into a given target.  Supports */
  /*    x and y offsets as well as byte padded lines.                      */
  /*                                                                       */
  /* <Input>                                                               */
  /*    target      :: The target bitmap/pixmap.                           */
  /*                                                                       */
  /*    source      :: The input packed bitmap data.                       */
  /*                                                                       */
  /*    line_bits   :: The number of bits per line.                        */
  /*                                                                       */
  /*    byte_padded :: A flag which is true if lines are byte-padded.      */
  /*                                                                       */
  /*    x_offset    :: The horizontal offset.                              */
  /*                                                                       */
  /*    y_offset    :: The vertical offset.                                */
  /*                                                                       */
  /* <Note>                                                                */
  /*    IMPORTANT: The x and y offsets are relative to the top corner of   */
  /*               the target bitmap (unlike the normal TrueType           */
  /*               convention).  A positive y offset indicates a downwards */
  /*               direction!                                              */
  /*                                                                       */
  static void
  blit_sbit( FT_Bitmap*  target,
             FT_Byte*    source,
             FT_Int      line_bits,
             FT_Bool     byte_padded,
             FT_Int      x_offset,
             FT_Int      y_offset )
  {
    FT_Byte*   line_buff;
    FT_Int     line_incr;
    FT_Int     height;

    FT_UShort  acc;
    FT_UInt    loaded;


    /* first of all, compute starting write position */
    line_incr = target->pitch;
    line_buff = target->buffer;

    if ( line_incr < 0 )
      line_buff -= line_incr * ( target->rows - 1 );

    line_buff += ( x_offset >> 3 ) + y_offset * line_incr;

    /***********************************************************************/
    /*                                                                     */
    /* We use the extra-classic `accumulator' trick to extract the bits    */
    /* from the source byte stream.                                        */
    /*                                                                     */
    /* Namely, the variable `acc' is a 16-bit accumulator containing the   */
    /* last `loaded' bits from the input stream.  The bits are shifted to  */
    /* the upmost position in `acc'.                                       */
    /*                                                                     */
    /***********************************************************************/

    acc    = 0;  /* clear accumulator   */
    loaded = 0;  /* no bits were loaded */

    for ( height = target->rows; height > 0; height-- )
    {
      FT_Byte*  cur   = line_buff;        /* current write cursor          */
      FT_Int    count = line_bits;        /* # of bits to extract per line */
      FT_Byte   shift = (FT_Byte)( x_offset & 7 ); /* current write shift  */
      FT_Byte   space = (FT_Byte)( 8 - shift );


      /* first of all, read individual source bytes */
      if ( count >= 8 )
      {
        count -= 8;
        {
          do
          {
            FT_Byte  val;


            /* ensure that there are at least 8 bits in the accumulator */
            if ( loaded < 8 )
            {
              acc    |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded ));
              loaded += 8;
            }

            /* now write one byte */
            val = (FT_Byte)( acc >> 8 );
            if ( shift )
            {
              cur[0] |= (FT_Byte)( val >> shift );
              cur[1] |= (FT_Byte)( val << space );
            }
            else
              cur[0] |= val;

            cur++;
            acc   <<= 8;  /* remove bits from accumulator */
            loaded -= 8;
            count  -= 8;

          } while ( count >= 0 );
        }

        /* restore `count' to correct value */
        count += 8;
      }

      /* now write remaining bits (count < 8) */
      if ( count > 0 )
      {
        FT_Byte  val;


        /* ensure that there are at least `count' bits in the accumulator */
        if ( (FT_Int)loaded < count )
        {
          acc    |= (FT_UShort)((FT_UShort)*source++ << ( 8 - loaded ));
          loaded += 8;
        }

        /* now write remaining bits */
        val     = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) );
        cur[0] |= (FT_Byte)( val >> shift );

        if ( count > space )
          cur[1] |= (FT_Byte)( val << space );

        acc   <<= count;
        loaded -= count;
      }

      /* now, skip to next line */
      if ( byte_padded )
      {
        acc    = 0;
        loaded = 0;   /* clear accumulator on byte-padded lines */
      }

      line_buff += line_incr;
    }
  }


  static const FT_Frame_Field  sbit_metrics_fields[] =
  {
#undef  FT_STRUCTURE
#define FT_STRUCTURE  TT_SBit_MetricsRec

    FT_FRAME_START( 8 ),
      FT_FRAME_BYTE( height ),
      FT_FRAME_BYTE( width ),

      FT_FRAME_CHAR( horiBearingX ),
      FT_FRAME_CHAR( horiBearingY ),
      FT_FRAME_BYTE( horiAdvance ),

      FT_FRAME_CHAR( vertBearingX ),
      FT_FRAME_CHAR( vertBearingY ),
      FT_FRAME_BYTE( vertAdvance ),
    FT_FRAME_END
  };


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    TT_Load_SBit_Const_Metrics                                         */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Loads the metrics for `EBLC' index tables format 2 and 5.          */
  /*                                                                       */
  /* <Input>                                                               */
  /*    range  :: The target range.                                        */
  /*                                                                       */
  /*    stream :: The input stream.                                        */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FreeType error code.  0 means success.                             */
  /*                                                                       */
  static FT_Error
  Load_SBit_Const_Metrics( TT_SBit_Range  range,
                           FT_Stream      stream )
  {
    FT_Error  error;


    if ( FT_READ_ULONG( range->image_size ) )
      return error;

    return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics );
  }


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    TT_Load_SBit_Range_Codes                                           */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Loads the range codes for `EBLC' index tables format 4 and 5.      */
  /*                                                                       */
  /* <Input>                                                               */
  /*    range        :: The target range.                                  */
  /*                                                                       */
  /*    stream       :: The input stream.                                  */
  /*                                                                       */
  /*    load_offsets :: A flag whether to load the glyph offset table.     */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FreeType error code.  0 means success.                             */
  /*                                                                       */
  static FT_Error
  Load_SBit_Range_Codes( TT_SBit_Range  range,
                         FT_Stream      stream,
                         FT_Bool        load_offsets )
  {
    FT_Error   error;
    FT_ULong   count, n, size;
    FT_Memory  memory = stream->memory;


    if ( FT_READ_ULONG( count ) )
      goto Exit;

    range->num_glyphs = count;

    /* Allocate glyph offsets table if needed */
    if ( load_offsets )
    {
      if ( FT_NEW_ARRAY( range->glyph_offsets, count ) )
        goto Exit;

      size = count * 4L;
    }
    else
      size = count * 2L;

    /* Allocate glyph codes table and access frame */
    if ( FT_NEW_ARRAY ( range->glyph_codes, count ) ||
         FT_FRAME_ENTER( size )                     )
      goto Exit;

    for ( n = 0; n < count; n++ )
    {
      range->glyph_codes[n] = FT_GET_USHORT();

      if ( load_offsets )
        range->glyph_offsets[n] = (FT_ULong)range->image_offset +
                                  FT_GET_USHORT();
    }

    FT_FRAME_EXIT();

  Exit:
    return error;
  }


  /*************************************************************************/
  /*                                                                       */
  /* <Function>                                                            */
  /*    TT_Load_SBit_Range                                                 */
  /*                                                                       */
  /* <Description>                                                         */
  /*    Loads a given `EBLC' index/range table.                            */
  /*                                                                       */
  /* <Input>                                                               */
  /*    range  :: The target range.                                        */
  /*                                                                       */
  /*    stream :: The input stream.                                        */
  /*                                                                       */
  /* <Return>                                                              */
  /*    FreeType error code.  0 means success.                             */
  /*                                                                       */
  static FT_Error
  Load_SBit_Range( TT_SBit_Range  range,
                   FT_Stream      stream )
  {
    FT_Error   error;
    FT_Memory  memory = stream->memory;


    switch( range->index_format )
    {
    case 1:   /* variable metrics with 4-byte offsets */
    case 3:   /* variable metrics with 2-byte offsets */
      {
        FT_ULong  num_glyphs, n;
        FT_Int    size_elem;
        FT_Bool   large = FT_BOOL( range->index_format == 1 );



        if ( range->last_glyph < range->first_glyph )
        {
          error = SFNT_Err_Invalid_File_Format;
          goto Exit;
        }

        num_glyphs        = range->last_glyph - range->first_glyph + 1L;
        range->num_glyphs = num_glyphs;
        num_glyphs++;                       /* XXX: BEWARE - see spec */

        size_elem = large ? 4 : 2;

        if ( FT_NEW_ARRAY( range->glyph_offsets, num_glyphs ) ||
             FT_FRAME_ENTER( num_glyphs * size_elem )         )
          goto Exit;

        for ( n = 0; n < num_glyphs; n++ )
          range->glyph_offsets[n] = (FT_ULong)( range->image_offset +
                                                ( large ? FT_GET_ULONG()
                                                        : FT_GET_USHORT() ) );
        FT_FRAME_EXIT();
      }
      break;

    case 2:   /* all glyphs have identical metrics */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线无精精品入口| 日本一区二区高清| 国产亚洲精品bt天堂精选| 亚洲日本护士毛茸茸| 狠狠久久亚洲欧美| 欧美日韩一区三区四区| 综合欧美亚洲日本| 国产原创一区二区三区| 欧美一区二区三区男人的天堂| 国产精品无人区| 国产一区二区美女| 日韩一区二区三区视频在线观看| 一区二区三区四区高清精品免费观看 | 欧美日韩国产综合视频在线观看 | 亚洲影视资源网| 不卡的电影网站| 国产亚洲综合色| 国产一区二区视频在线播放| 欧美一级免费观看| 丝袜美腿一区二区三区| 欧美日韩国产小视频在线观看| 亚洲免费在线观看| 91免费看片在线观看| 自拍偷在线精品自拍偷无码专区| 国产成a人亚洲| 国产女同性恋一区二区| 高清久久久久久| 国产精品网曝门| 成人黄色一级视频| 国产精品久久久久久久裸模 | 日韩一级片网址| 蜜臀av国产精品久久久久| 欧美乱妇15p| 蜜桃一区二区三区四区| 日韩欧美中文一区二区| 国产一区二区伦理片| 国产欧美一区二区三区在线看蜜臀 | 无码av免费一区二区三区试看 | 欧美人动与zoxxxx乱| 午夜一区二区三区在线观看| 69堂成人精品免费视频| 视频一区中文字幕国产| 欧美一级专区免费大片| 狠狠色狠狠色合久久伊人| 久久久久久久久久看片| av在线不卡免费看| 香港成人在线视频| 精品国产电影一区二区| 大白屁股一区二区视频| 自拍av一区二区三区| 欧美日本一区二区三区| 精品一区二区久久久| 国产精品久久久久久亚洲毛片| 色94色欧美sute亚洲线路一ni| 亚洲综合精品自拍| 2017欧美狠狠色| 92国产精品观看| 日韩av电影免费观看高清完整版 | 欧美成人乱码一区二区三区| 激情深爱一区二区| 亚洲色图欧美偷拍| 精品久久久三级丝袜| 99久久精品一区| 青娱乐精品在线视频| 中文一区一区三区高中清不卡| 99精品视频一区二区三区| 日韩在线a电影| 国产精品欧美一级免费| 欧美一区二区三区在线看| 不卡影院免费观看| 日韩电影免费一区| 亚洲图片你懂的| 久久综合色综合88| 欧美日韩国产综合久久 | 日韩一区二区免费电影| 成人性视频网站| 日韩高清国产一区在线| 亚洲三级视频在线观看| 精品国产乱码久久久久久久 | 久久影院电视剧免费观看| 欧美性色黄大片手机版| 国产伦精品一区二区三区视频青涩| 亚洲最大色网站| 一区在线中文字幕| 久久先锋影音av| 日韩欧美色电影| 精品视频999| 色婷婷综合久色| 成人国产精品免费网站| 国产九色sp调教91| 久久99国产精品尤物| 天堂一区二区在线| 一区二区三区国产精华| 日韩一区日韩二区| 国产精品美女视频| 欧美激情一区二区三区全黄| 精品国产乱码久久久久久牛牛| 91精品免费观看| 在线成人午夜影院| 欧美日韩视频不卡| 91国在线观看| 在线观看av不卡| 日本精品免费观看高清观看| 91免费版pro下载短视频| 高清beeg欧美| www.欧美.com| 成人美女视频在线观看18| 成人午夜碰碰视频| www.欧美.com| 色婷婷亚洲综合| 色婷婷久久久久swag精品| 一本一道综合狠狠老| 欧美中文字幕亚洲一区二区va在线 | www.性欧美| 不卡高清视频专区| a4yy欧美一区二区三区| a级精品国产片在线观看| 97精品久久久久中文字幕| 色综合久久综合网欧美综合网| 色婷婷综合久久久久中文一区二区| 99精品视频在线观看免费| 欧洲av一区二区嗯嗯嗯啊| 欧美视频精品在线| 欧美成人福利视频| 国产亚洲一区字幕| 综合激情成人伊人| 亚洲成a人v欧美综合天堂下载| 无吗不卡中文字幕| 黄色日韩网站视频| 不卡的av网站| 欧美日韩精品欧美日韩精品一综合| 欧美一级片在线观看| 国产免费成人在线视频| 尤物在线观看一区| 麻豆精品视频在线| 国产成人免费xxxxxxxx| 91视频精品在这里| 91麻豆精品国产无毒不卡在线观看| 欧美本精品男人aⅴ天堂| 国产精品国产三级国产普通话三级 | 欧美女孩性生活视频| 日韩免费电影一区| 中文字幕佐山爱一区二区免费| 亚洲国产成人精品视频| 国产伦精品一区二区三区免费迷 | 亚洲一区二区三区中文字幕| 麻豆精品一区二区av白丝在线| 成人精品国产免费网站| 欧美日本高清视频在线观看| 久久精品亚洲国产奇米99| 亚洲第一av色| 成人在线视频一区| 日韩欧美高清在线| 亚洲精品中文字幕在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| av激情成人网| 久久综合色播五月| 亚洲一区二区三区中文字幕| 国产成人精品免费视频网站| 欧美日韩高清不卡| 亚洲欧洲一区二区在线播放| 麻豆久久一区二区| 欧美视频三区在线播放| 中文字幕亚洲欧美在线不卡| 蜜臀久久99精品久久久画质超高清| 成人av在线播放网址| 日韩一区二区免费在线电影| 伊人婷婷欧美激情| 成人午夜短视频| 欧美精品一区二区久久婷婷| 亚洲成人久久影院| 91久久一区二区| 亚洲欧美综合另类在线卡通| 国产资源在线一区| 欧美r级在线观看| 三级一区在线视频先锋| 91网站最新地址| 国产精品麻豆视频| 国产成人福利片| 久久久三级国产网站| 九九在线精品视频| 欧美成人精品福利| 美女视频黄 久久| 这里只有精品免费| 爽好多水快深点欧美视频| 欧美性色aⅴ视频一区日韩精品| 亚洲视频你懂的| 9久草视频在线视频精品| 中文字幕av在线一区二区三区| 精品中文字幕一区二区| 欧美二区三区的天堂| 欧美96一区二区免费视频| 91精品国产综合久久小美女| 日韩国产精品久久久| 制服丝袜成人动漫| 蜜桃av一区二区三区| 精品国产免费一区二区三区四区 | www国产精品av| 国产一区二区三区av电影| 国产调教视频一区|