FontInterface.h
上传用户:poi891205
上传日期:2013-07-15
资源大小:9745k
文件大小:10k
源码类别:

DVD

开发平台:

C/C++

  1. /**************************************************************************
  2.  *                                                                        *
  3.  *         Copyright (c) 2002 by Sunplus Technology Co., Ltd.             *
  4.  *                                                                        *
  5.  *  This software is copyrighted by and is the property of Sunplus        *
  6.  *  Technology Co., Ltd. All rights are reserved by Sunplus Technology    *
  7.  *  Co., Ltd. This software may only be used in accordance with the       *
  8.  *  corresponding license agreement. Any unauthorized use, duplication,   *
  9.  *  distribution, or disclosure of this software is expressly forbidden.  *
  10.  *                                                                        *
  11.  *  This Copyright notice MUST not be removed or modified without prior   *
  12.  *  written consent of Sunplus Technology Co., Ltd.                       *
  13.  *                                                                        *
  14.  *  Sunplus Technology Co., Ltd. reserves the right to modify this        *
  15.  *  software without notice.                                              *
  16.  *                                                                        *
  17.  *  Sunplus Technology Co., Ltd.                                          *
  18.  *  19, Innovation First Road, Science-Based Industrial Park,             *
  19.  *  Hsin-Chu, Taiwan, R.O.C.                                              *
  20.  **************************************************************************/
  21. /*--------------------------------------------------------------------------
  22. |  File Name   :  FontInterface.h
  23. |
  24. |  Description :  Font Interface Header File
  25. |
  26. |  Version    :  0.1  
  27. |  Rev Date         Author(s)      Status & Comments
  28. |---------------------------------------------------------------------------------
  29. |  0.1 2004/11/22      yltseng         Creating
  30. |--------------------------------------------------------------------------------*/ 
  31. #ifndef _FONT_INTERFACE_H_
  32. #define _FONT_INTERFACE_H_
  33. #include "types.h"
  34. // **************************************************************************************** //
  35. typedef enum
  36. {
  37.     FONT_NONE       = 0,
  38.     FONT_BIG5,
  39.     FONT_BIG5_COMMON,
  40.     FONT_GB2312,
  41.     FONT_JIS,
  42.     FONT_KSC,
  43.     FONT_RUSSIAN,
  44.     FONT_ISO_8859_1,
  45.     FONT_ISO_8859_2,
  46.     FONT_ISO_8859_5,
  47.     FONT_ISO_8859_9,
  48. } ENUM_FONT_TYPE;
  49. typedef enum
  50. {
  51.     FONT_NOT_IN_RANGE   = 0,
  52.     FONT_ONE_BYTE,
  53.     FONT_TWO_BYTE,
  54. } ENUM_FONT_SIZE;
  55. typedef struct
  56. {
  57.     const UINT8*    aRange[2];              // For single byte character, put range in aRange[1], and set aRange[0] to NULL
  58.     const UINT8*    pTranslateTbl;
  59.     UINT8           aRangeNum[2];
  60.     ENUM_FONT_TYPE  enType;
  61.     UINT8           uiTranslateTblNum;
  62.     UINT8           uiWidth;
  63.     UINT8           uiHeight;
  64. }   FontInfo;
  65. // **************************************************************************************** //
  66. /**************************************************************************
  67.  *  Function Name: ftSetCurrentFont                                       *
  68.  *  Purposes:                                                             *
  69.  *    Set current font's information and data buffer address.             *
  70.  *  Descriptions:                                                         *
  71.  *    Font info structure is defined in FontInterface.h. And it can be    *
  72.  *    seperated from font's raw data. That is I can use same font info on *
  73.  *    two different raw data. For example, I can use english's font info  *
  74.  *    on 12x12 english raw data or on 24x24 english raw data.             *
  75.  *  Arguments:                                                            *
  76.  *    pFont    : Pointer to font's information, it describes this font's  *
  77.  *    code range, font size ... etc.                                      *
  78.  *    pFontData: Pointer to font's data buffer, and this buffer should    *
  79.  *    contain bmp raw data of this font.                                  *
  80.  *  Returns:                                                              *
  81.  *    TRUE if success, FALSE otherwise.                                   *
  82.  *  See also:                                                             *
  83.  *    ftIsInCharacterSet, ftGetCharacterBmp, ftGetFontType                *
  84.  **************************************************************************/
  85. extern UINT32           ftSetCurrentFont( const FontInfo* pFont, const UINT8* pFontData );
  86. /**************************************************************************
  87.  *  Function Name: ftIsInCharacterSet                                     *
  88.  *  Purposes:                                                             *
  89.  *    Find out if this character is in current character set or not.      *
  90.  *  Descriptions:                                                         *
  91.  *    None                                                                *
  92.  *  Arguments:                                                            *
  93.  *    pCode: Pointer to character. Depending on different language, it may*
  94.  *    point to 2 byte char(eg:Chinese) or 1 byte character(eg:English)    *
  95.  *  Returns:                                                              *
  96.  *    FONT_NOT_IN_RANGE: Not in current character set                     *
  97.  *    FONT_ONE_BYTE    : In current character set, and is 1 byte character*
  98.  *    FONT_TWO_BYTE    : In current character set, and is 2 byte character*
  99.  *  See also:                                                             *
  100.  *    ftSetCurrentFont, ftGetCharacterBmp, ftGetFontType                  *
  101.  **************************************************************************/
  102. extern UINT32           ftIsInCharacterSet( const UINT8* pCode );
  103. /**************************************************************************
  104.  *  Function Name: ftGetCharacterBmp                                      *
  105.  *  Purposes:                                                             *
  106.  *    Get input character's bmp raw data.                                 *
  107.  *  Descriptions:                                                         *
  108.  *    None                                                                *
  109.  *  Arguments:                                                            *
  110.  *    pCode: Pointer to character. Depending on different language, it may*
  111.  *    point to 2 byte char(eg:Chinese) or 1 byte character(eg:English)    *
  112.  *    pBmp : Pointer to pointer to bmp raw data, if pCode is in current   *
  113.  *    character set, we will write UINT8* into pBmp, thus pBmp contains   *
  114.  *    pointer to this character's bmp.                                    *
  115.  *  Returns:                                                              *
  116.  *    FONT_NOT_IN_RANGE: Not in current character set                     *
  117.  *    FONT_ONE_BYTE    : In current character set, and is 1 byte character*
  118.  *    FONT_TWO_BYTE    : In current character set, and is 2 byte character*
  119.  *  See also:                                                             *
  120.  *    ftSetCurrentFont, ftIsInCharacterSet, ftGetFontType                 *
  121.  **************************************************************************/
  122. extern UINT32           ftGetCharacterBmp( const UINT8* pCode, const UINT8** pBmp );
  123. /**************************************************************************
  124.  *  Function Name: ftGetFontType                                          *
  125.  *  Purposes:                                                             *
  126.  *    Get what current character set is.                                  *
  127.  *  Descriptions:                                                         *
  128.  *    None                                                                *
  129.  *  Arguments:                                                            *
  130.  *    None                                                                *
  131.  *  Returns:                                                              *
  132.  *    ENUM_FONT_TYPE, see FontInterface.h. It represents what current     *
  133.  *    character set is.                                                   *
  134.  *  See also:                                                             *
  135.  *    ftSetCurrentFont, ftIsInCharacterSet, ftGetCharacterBmp             *
  136.  **************************************************************************/
  137. extern ENUM_FONT_TYPE   ftGetFontType();
  138. // **************************************************************************************** //
  139. extern const FontInfo   g_Big5FontInfo;
  140. extern const BYTE       JMT_BIG5_12X12_FONT_BITMAP[];
  141. extern const BYTE       font_BIG5_compressed[];
  142. extern const FontInfo   g_Big5CommonFontInfo;
  143. extern const BYTE       JMT_BIG5_12X12_FONT_BITMAP_COMMON[];
  144. extern const BYTE       font_BIG5_common_compressed[];
  145. extern const FontInfo   g_GBFontInfo;
  146. extern const BYTE       GUO_GB2312_12X12_FONT_BITMAP[];
  147. extern const BYTE       font_GB2312_compressed[];
  148. extern const FontInfo   g_JISFontInfo;
  149. extern const BYTE       JP_JISX0213_12X12_FONT_BITMAP[];
  150. extern const BYTE       font_JIS_compressed[];
  151. extern const FontInfo   g_KSCFontInfo;
  152. extern const BYTE       KO_KSC_12X12_FONT_BITMAP[];
  153. extern const BYTE       font_KSC_compressed[];
  154. extern const FontInfo   g_RussianFontInfo;
  155. extern const BYTE       GUO_GB2312_Russian_12X12_FONT_BITMAP[];
  156. extern const BYTE       font_Russian_compressed[];
  157. extern const FontInfo   g_8859_1FontInfo;
  158. extern const BYTE       ISO_8859_1_12X24_FONT_BITMAP[];
  159. extern const BYTE       font_ISO_8859_1_compressed[];
  160. extern const FontInfo   g_8859_2FontInfo;
  161. extern const BYTE       ISO_8859_2_12X24_FONT_BITMAP[];
  162. extern const BYTE       font_ISO_8859_2_compressed[];
  163. extern const FontInfo   g_8859_5FontInfo;
  164. extern const BYTE       ISO_8859_5_12X24_FONT_BITMAP[];
  165. extern const FontInfo   g_8859_9FontInfo;
  166. extern const BYTE       ISO_8859_9_12X24_FONT_BITMAP[];
  167. extern const BYTE       font_ISO_8859_9_compressed[];
  168. // **************************************************************************************** //
  169. #endif