Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
5.0 KiB

  1. //
  2. // Copyright (c) 1997-1999 Microsoft Corporation.
  3. //
  4. /*
  5. CWIN31 EUDC Format and ETEN format
  6. The structures are not aligned to word order. For the reason, it is need to use
  7. 'char' array base structures for the purpose of R/W files.
  8. For the further item, the word is strored in Intel monor, use set/get functions.
  9. +---------------------------+
  10. | File Header 256 bytes | -----> USERFONTHEADER
  11. +---------------------------+
  12. | Code Bank ID 2 bytes | ~|
  13. +---------------------------+ |---> CODEELEMENT
  14. | DBCS Code 2 bytes | _|
  15. +---------------------------+
  16. | Patten ?? bytes | -----> Glyph Patten depend on width and height
  17. +---------------------------+
  18. . .
  19. . .
  20. . .
  21. +---------------------------+
  22. | Code Bank ID 2 bytes |
  23. +---------------------------+
  24. | DBCS Code 2 bytes |
  25. +---------------------------+
  26. | Patten ?? bytes | ---> Byte Boundary,remaining bits are not stable
  27. +---------------------------+
  28. */
  29. #ifdef BUILD_ON_WINNT
  30. #pragma pack(1)
  31. #endif // BUILD_ON_WINNT
  32. struct CFONTINFO {
  33. unsigned short uInfoSize; // Size of this structure.
  34. unsigned short idCP; // Code page ID 938 for Taiwan.
  35. char idCharSet; // Character set is CHINESEBIG5_CHARSET
  36. char fbTypeFace; // Type face.
  37. char achFontName[12]; // Font Name.
  38. unsigned long ulCharDefine; // Number of usable characters.
  39. unsigned short uCellWidth; // Width of font cell.
  40. unsigned short uCellHeight; // Height of font cell.
  41. unsigned short uCharHeight; // Height of character height.
  42. unsigned short uBaseLine; //
  43. unsigned short uUnderLine; //
  44. unsigned short uUnlnHeight; // Height of underline.
  45. char fchStrokeWeight; // Weight of font (Bold or Thin)
  46. unsigned short fCharStyle; // italy
  47. char fbFontAttrib; //
  48. unsigned long ulCellWidthMax; // Max width of font cell.
  49. unsigned long ulCellHeightMax; // Max height of font cell.
  50. };
  51. struct ETENHEADER {
  52. unsigned short uHeaderSize; // Size of this structure.
  53. char idUserFontSign[8]; // Must be "CWIN_PTN", "CMEX_PTN"
  54. char idMajor; // Version number if it is 1.0 then
  55. char idMinor; // idMajor is 1 and idMinor is 0
  56. unsigned long ulCharCount; // Number of characters in file
  57. unsigned short uCharWidth; // Width of the character.
  58. unsigned short uCharHeight; // Height of the character.
  59. unsigned long cPatternSize; // size of pattern in byte.
  60. char uchBankID; // if data is in same bank.
  61. unsigned short idInternalBankID; // Internal code bank ID.
  62. char achReserved1[37]; // must be zero.
  63. struct CFONTINFO sFontInfo; // chinese font structure.
  64. char achReserved2[18]; // must be zero.
  65. char achCopyRightMsg[128]; // Copyright message.
  66. };
  67. struct CODEELEMENT {
  68. unsigned short nBankID; // BankID
  69. unsigned short nInternalCode; // Internal Code
  70. };
  71. struct R_CFONTINFO {
  72. unsigned char uInfoSize[2]; // Size of this structure.
  73. unsigned char idCP[2]; // Code page ID 938 for Taiwan.
  74. char idCharSet; // Character set is CHINESEBIG5_CHARSET
  75. char fbTypeFace; // Type face.
  76. char achFontName[12]; // Font Name.
  77. unsigned char ulCharDefine[4]; // Number of usable characters.
  78. unsigned char uCellWidth[2]; // Width of font cell.
  79. unsigned char uCellHeight[2]; // Height of font cell.
  80. unsigned char uCharHeight[2]; // Height of character height.
  81. unsigned char uBaseLine[2]; //
  82. unsigned char uUnderLine[2]; //
  83. unsigned char uUnlnHeight[2]; // Height of underline.
  84. char fchStrokeWeight; // Weight of font (Bold or Thin)
  85. unsigned char fCharStyle[2]; // italy
  86. char fbFontAttrib; //
  87. unsigned char ulCellWidthMax[4]; // Max width of font cell.
  88. unsigned char ulCellHeightMax[4]; // Max height of font cell.
  89. };
  90. struct R_ETENHEADER {
  91. unsigned char uHeaderSize[2]; // Size of this structure.
  92. char idUserFontSign[8]; // Must be "CWIN_PTN", "CMEX_PTN"
  93. char idMajor; // Version number if it is 1.0 then
  94. char idMinor; // idMajor is 1 and idMinor is 0
  95. unsigned char ulCharCount[4]; // Number of characters in file
  96. unsigned char uCharWidth[2]; // Width of the character.
  97. unsigned char uCharHeight[2]; // Height of the character.
  98. unsigned char cPatternSize[4]; // size of pattern in byte.
  99. char uchBankID; // if data is in same bank.
  100. unsigned char idInternalBankID[2]; // Internal code bank ID.
  101. char achReserved1[37]; // must bezero.
  102. struct R_CFONTINFO sFontInfo; // chinese font structure.
  103. char achReserved2[18]; // must be zero.
  104. char achCopyRightMsg[128]; // Copyright message.
  105. };
  106. struct R_CODEELEMENT {
  107. unsigned char nBankID[2]; // BankID
  108. unsigned char nInternalCode[2]; // Internal Code
  109. };
  110. /* Open Mode */
  111. #define ETEN_READ 0
  112. #define ETEN_WRITE 1
  113. int openETENBMP(TCHAR *path,int md);
  114. int closeETENBMP(void);
  115. int createETENBMP(TCHAR *path,int width,int height);
  116. int readETENBMPRec(int rec,LPBYTE buf,int bufsiz,unsigned short *code);
  117. int appendETENBMP(LPBYTE buf,unsigned short code);
  118. #ifdef BUILD_ON_WINNT
  119. #pragma pack()
  120. #endif // BUILD_ON_WINNT
  121. /* EOF */