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.

156 lines
3.1 KiB

  1. /*+
  2. Copyright (c) 1996 Adobe Systems Incorporated
  3. Copyright (c) 1996 Microsoft Corporation
  4. Module Name:
  5. cjkfonts.h
  6. Abstract:
  7. Convert CJK AFMs to NTMs.
  8. Environment:
  9. Windows NT PostScript driver: makentf utility.
  10. Revision History:
  11. 1/13/96 -rkiesler-
  12. Wrote it.
  13. -*/
  14. //
  15. // Various #defines.
  16. //
  17. #define NUM_CJK_CHAR_ORDERINGS 4
  18. //
  19. // Some defines to make stuff read nice.
  20. //
  21. #define H_CMAP 0 // Horizontal variant CMAP info
  22. #define V_CMAP 1 // Index of Vertical variant CMAP info
  23. #define NUM_VARIANTS V_CMAP + 1 // Total number of variants
  24. //
  25. // CMap specific tokens
  26. //
  27. #define CMAP_NAME_TOK "/CMapName"
  28. #define CID_RANGE_TOK "begincidrange"
  29. #define DSC_EOF_TOK "%%EOF"
  30. //
  31. // CJK specific data structures.
  32. //
  33. typedef struct _CMAPRANGE
  34. {
  35. ULONG CIDStrt;
  36. USHORT ChCodeStrt;
  37. USHORT cChars;
  38. } CMAPRANGE, *PCMAPRANGE;
  39. typedef struct _CMAP
  40. {
  41. ULONG cRuns;
  42. ULONG cChars;
  43. CMAPRANGE CMapRange[1];
  44. } CMAP, *PCMAP;
  45. //
  46. // Macros for parsing a Postscript CMap.
  47. //
  48. #define GET_NUM_CID_RANGES(pToken, numRanges) \
  49. while (!IS_WHTSPACE(pToken)) \
  50. { \
  51. pToken--; \
  52. } \
  53. while (IS_WHTSPACE(pToken)) \
  54. { \
  55. pToken--; \
  56. } \
  57. while (!IS_WHTSPACE(pToken)) \
  58. { \
  59. pToken--; \
  60. } \
  61. pToken++; \
  62. numRanges = atoi(pToken)
  63. ULONG
  64. CreateCJKGlyphSets(
  65. PBYTE *pColCMaps,
  66. PBYTE *pUniCMaps,
  67. PGLYPHSETDATA *pGlyphSets,
  68. PWINCODEPAGE pWinCodePage,
  69. PULONG *pUniPsTbl
  70. );
  71. BOOLEAN
  72. NumUV2CIDRuns(
  73. PBYTE pCMapFile,
  74. PULONG pcRuns,
  75. PULONG pcChars
  76. );
  77. BOOLEAN
  78. BuildUV2CIDMap(
  79. PBYTE pCMapFile,
  80. PCMAP pCMap
  81. );
  82. BOOLEAN
  83. NumUV2CCRuns(
  84. PBYTE pFile,
  85. PULONG pcRuns,
  86. PULONG pcChars
  87. );
  88. BOOLEAN
  89. BuildUV2CCMap(
  90. PBYTE pFile,
  91. PCMAP pCMap
  92. );
  93. int __cdecl
  94. CmpCMapRunsCID(
  95. const VOID *p1,
  96. const VOID *p2
  97. );
  98. int __cdecl
  99. CmpCMapRunsChCode(
  100. const VOID *p1,
  101. const VOID *p2
  102. );
  103. int __cdecl
  104. FindCIDRun(
  105. const VOID *p1,
  106. const VOID *p2
  107. );
  108. int __cdecl
  109. FindChCodeRun(
  110. const VOID *p1,
  111. const VOID *p2
  112. );
  113. CHSETSUPPORT
  114. IsCJKFont(
  115. PBYTE pAFM
  116. );
  117. BOOLEAN
  118. IsVGlyphSet(
  119. PGLYPHSETDATA pGlyphSetData
  120. );
  121. BOOLEAN
  122. BIsCloneFont(
  123. PBYTE pAFM
  124. );
  125. BOOLEAN
  126. IsCIDFont(
  127. PBYTE pAFM
  128. );