tt_font.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. /*****************************************************************************
  2. ** File: tt_font.h
  3. **
  4. ** Description: Contains prototypes for TT font related APIs.
  5. **
  6. ** Copyright(c) 2008 Sunmedia Technologies - All Rights Reserved
  7. **
  8. ** Author :
  9. **
  10. ** $Id:
  11. *****************************************************************************/
  12. #ifndef _TT_FONT_H_
  13. #define _TT_FONT_H_
  14. #include "stddefs.h"
  15. #ifdef CONFIG_TTF12X10_SUPPORT
  16. #define TT_NEWFONT_SUPPORT (0)
  17. #else
  18. #define TT_NEWFONT_SUPPORT (1)
  19. #endif
  20. typedef enum {
  21. FONT_TTX_NO_CHARSET = 0,
  22. FONT_TTX_LATIN_G0,
  23. FONT_TTX_LATIN_NATIONAL_OP,
  24. FONT_TTX_LATIN_G2,
  25. FONT_TTX_CYRILLIC_G0_OPTION1,
  26. FONT_TTX_CYRILLIC_G0_OPTION2,
  27. FONT_TTX_CYRILLIC_G0_OPTION3,
  28. FONT_TTX_CYRILLIC_G2,
  29. FONT_TTX_GREEK_G0,
  30. FONT_TTX_GREEK_G2,
  31. FONT_TTX_ARABIC_G0,
  32. FONT_TTX_ARABIC_G2,
  33. FONT_TTX_HEBREW_G0,
  34. FONT_TTX_FARSI_G0,
  35. FONT_TTX_FARSI_G2,
  36. FONT_TTX_MOSAICS_G1,
  37. FONT_TTX_MOSAICS_G3,
  38. FONT_TTX_LAST
  39. } FONT_TT_CharSet_e;
  40. typedef enum {
  41. FONT_TTX_SUBSET_NO_SUBSET = 0,
  42. FONT_TTX_SUBSET_CZECH,
  43. FONT_TTX_SUBSET_SLOVAK = FONT_TTX_SUBSET_CZECH,
  44. FONT_TTX_SUBSET_ENGLISH,
  45. FONT_TTX_SUBSET_ESTONIAN,
  46. FONT_TTX_SUBSET_FRENCH,
  47. FONT_TTX_SUBSET_GERMAN,
  48. FONT_TTX_SUBSET_ITALIAN,
  49. FONT_TTX_SUBSET_LETTISH,
  50. FONT_TTX_SUBSET_LITHUANIAN = FONT_TTX_SUBSET_LETTISH,
  51. FONT_TTX_SUBSET_POLISH,
  52. FONT_TTX_SUBSET_PORTUGUESE,
  53. FONT_TTX_SUBSET_SPANISH = FONT_TTX_SUBSET_PORTUGUESE,
  54. FONT_TTX_SUBSET_RUMANIAN,
  55. FONT_TTX_SUBSET_SERBIAN,
  56. FONT_TTX_SUBSET_CROATIAN = FONT_TTX_SUBSET_SERBIAN,
  57. FONT_TTX_SUBSET_SLOVENIAN = FONT_TTX_SUBSET_SERBIAN,
  58. FONT_TTX_SUBSET_SWEDISH,
  59. FONT_TTX_SUBSET_FINNISH = FONT_TTX_SUBSET_SWEDISH,
  60. FONT_TTX_SUBSET_TURKISH,
  61. FONT_TTX_SUBSET_LAST
  62. } FONT_TT_NationalOpSubSet_e;
  63. /** TT national option encode */
  64. typedef enum {
  65. FONT_TTX_NATIONAL_OP_EN23_IDX = 0,
  66. FONT_TTX_NATIONAL_OP_EN24_IDX,
  67. FONT_TTX_NATIONAL_OP_EN40_IDX,
  68. FONT_TTX_NATIONAL_OP_EN5B_IDX,
  69. FONT_TTX_NATIONAL_OP_EN5C_IDX,
  70. FONT_TTX_NATIONAL_OP_EN5D_IDX,
  71. FONT_TTX_NATIONAL_OP_EN5E_IDX,
  72. FONT_TTX_NATIONAL_OP_EN5F_IDX,
  73. FONT_TTX_NATIONAL_OP_EN60_IDX,
  74. FONT_TTX_NATIONAL_OP_EN7B_IDX,
  75. FONT_TTX_NATIONAL_OP_EN7C_IDX,
  76. FONT_TTX_NATIONAL_OP_EN7D_IDX,
  77. FONT_TTX_NATIONAL_OP_EN7E_IDX,
  78. FONT_TTX_NATIONAL_OP_EN_IDX_LAST
  79. } FONT_TT_NationalOpEncodeIdx_e;
  80. /*font header*/
  81. typedef struct {
  82. UINT8 u8Version;
  83. UINT8 u8HeadSize;
  84. UINT8 u8Baseline;
  85. UINT8 u8Width;
  86. UINT8 u8Height;
  87. UINT16 u16MinCode;
  88. UINT16 u16MaxCode;
  89. UINT16 u16CodePage;
  90. UINT16 u16Flag;
  91. UINT16 u16CharNum;
  92. UINT16 u16AreaNum;
  93. } FONT_TT_Header_t;
  94. typedef struct {
  95. INT32 *p_array;
  96. INT8 p_style;
  97. INT32 p_size;
  98. INT8 p_char_spacing;
  99. } FONT_TT_Info_t;
  100. typedef struct _TtCharInfo_t {
  101. UINT8 bTtCharCode;
  102. UINT8 bTtCharWidth;
  103. UINT8 bTtCharHeight;
  104. UINT8 *pTtCharBmp;
  105. UINT8 bHasMarkFlag;
  106. FONT_TT_CharSet_e eTtCharset;
  107. FONT_TT_NationalOpSubSet_e eTtSubset;
  108. } TtCharInfo_t;
  109. //INT32 GDI_tt_fill_rect(HDC hdc, RECT *rect, UINT32 color);
  110. void FONT_TT_Set_FontRes(FONT_TT_Info_t *pFontRes);
  111. INT32 FONT_get_tt_char_info(TtCharInfo_t *pstCharInfo);
  112. #endif /* _TT_FONT_H_ */