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.

178 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. ntm.h
  5. Abstract:
  6. Header file for NTM data.
  7. Environment:
  8. Windows NT PostScript driver.
  9. Revision History:
  10. 09/16/96 -slam-
  11. Created.
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _PSNTM_H_
  16. #define _PSNTM_H_
  17. #ifdef KERNEL_MODE
  18. // Declarations used when compiling for kernel mode
  19. #define MULTIBYTETOUNICODE EngMultiByteToUnicodeN
  20. #define UNICODETOMULTIBYTE EngUnicodeToMultiByteN
  21. #else //!KERNEL_MODE
  22. // Declarations used when compiling for user mode
  23. LONG
  24. RtlMultiByteToUnicodeN(
  25. PWSTR UnicodeString,
  26. ULONG MaxBytesInUnicodeString,
  27. PULONG BytesInUnicodeString,
  28. PCHAR MultiByteString,
  29. ULONG BytesInMultiByteString
  30. );
  31. LONG
  32. RtlUnicodeToMultiByteN(
  33. PCHAR MultiByteString,
  34. ULONG MaxBytesInMultiByteString,
  35. PULONG BytesInMultiByteString,
  36. PWSTR UnicodeString,
  37. ULONG BytesInUnicodeString
  38. );
  39. #define MULTIBYTETOUNICODE RtlMultiByteToUnicodeN
  40. #define UNICODETOMULTIBYTE RtlUnicodeToMultiByteN
  41. #endif //!KERNEL_MODE
  42. #define DWORDALIGN(a) ((a + (sizeof(DWORD) - 1)) & ~(sizeof(DWORD) - 1))
  43. typedef struct _EXTTEXTMETRIC
  44. {
  45. SHORT etmSize;
  46. SHORT etmPointSize;
  47. SHORT etmOrientation;
  48. SHORT etmMasterHeight;
  49. SHORT etmMinScale;
  50. SHORT etmMaxScale;
  51. SHORT etmMasterUnits;
  52. SHORT etmCapHeight;
  53. SHORT etmXHeight;
  54. SHORT etmLowerCaseAscent;
  55. SHORT etmLowerCaseDescent;
  56. SHORT etmSlant;
  57. SHORT etmSuperScript;
  58. SHORT etmSubScript;
  59. SHORT etmSuperScriptSize;
  60. SHORT etmSubScriptSize;
  61. SHORT etmUnderlineOffset;
  62. SHORT etmUnderlineWidth;
  63. SHORT etmDoubleUpperUnderlineOffset;
  64. SHORT etmDoubleLowerUnderlineOffset;
  65. SHORT etmDoubleUpperUnderlineWidth;
  66. SHORT etmDoubleLowerUnderlineWidth;
  67. SHORT etmStrikeOutOffset;
  68. SHORT etmStrikeOutWidth;
  69. WORD etmNKernPairs;
  70. WORD etmNKernTracks;
  71. } EXTTEXTMETRIC;
  72. #define CHARSET_UNKNOWN 0
  73. #define CHARSET_STANDARD 1
  74. #define CHARSET_SPECIAL 2
  75. #define CHARSET_EXTENDED 3
  76. typedef struct _NTM {
  77. DWORD dwSize; // size of font metrics data
  78. DWORD dwVersion; // NTFM version number
  79. DWORD dwFlags; // flags
  80. DWORD dwFontNameOffset; // offset to font name
  81. DWORD dwDisplayNameOffset; // offset to display name
  82. DWORD dwFontVersion; // font version number
  83. DWORD dwGlyphSetNameOffset; // offset to glyphset name
  84. DWORD dwGlyphCount; // number of glyphs supported
  85. DWORD dwIFIMetricsOffset; // offset to the first IFIMETRICS structure
  86. DWORD dwIFIMetricsOffset2; // offset to the second IFIMETRICS structure
  87. DWORD dwCharWidthCount; // number of char width entries
  88. DWORD dwCharWidthOffset; // offset to array char width entries
  89. DWORD dwDefaultCharWidth; // default glyph width
  90. DWORD dwKernPairCount; // number of FD_KERNINGPAIRs
  91. DWORD dwKernPairOffset; // offset to array of FD_KERNINGPAIRs
  92. DWORD dwCharDefFlagOffset; // offset to bit tbl of defined chars
  93. DWORD dwCharSet; // font character set
  94. DWORD dwCodePage; // font codepage
  95. DWORD dwReserved[3]; // reserved
  96. EXTTEXTMETRIC etm; // extended text metrics info
  97. } NTM, *PNTM;
  98. #define NTM_VERSION 0x00010000
  99. // Macros to access NT font metrics structure.
  100. #define NTM_GET_SIZE(pNTM) (pNTM->dwSize)
  101. #define NTM_GET_FLAGS(pNTM) (pNTM->dwFlags)
  102. #define NTM_GET_FONT_NAME(pNTM) ((PSTR)MK_PTR(pNTM, dwFontNameOffset))
  103. #define NTM_GET_DISPLAY_NAME(pNTM) ((PWSTR)MK_PTR(pNTM, dwDisplayNameOffset))
  104. #define NTM_GET_GLYPHSET_NAME(pNTM) ((PSTR)MK_PTR(pNTM, dwGlyphSetNameOffset))
  105. #define NTM_GET_GLYPHCOUNT(pNTM) (pNTM->dwGlyphCount)
  106. #define NTM_GET_IFIMETRICS(pNTM) ((PIFIMETRICS)(MK_PTR(pNTM, dwIFIMetricsOffset)))
  107. #define NTM_GET_IFIMETRICS2(pNTM) ((PIFIMETRICS)(MK_PTR(pNTM, dwIFIMetricsOffset2)))
  108. #define NTM_GET_CHARWIDTHCOUNT(pNTM) (pNTM->dwCharWidthCount)
  109. #define NTM_GET_CHARWIDTH(pNTM) ((PWIDTHRUN)(MK_PTR(pNTM, dwCharWidthOffset)))
  110. #define NTM_GET_DEFCHARWIDTH(pNTM) (pNTM->dwDefaultCahrWidth)
  111. #define NTM_GET_KERNPAIRCOUNT(pNTM) (pNTM->dwKernPairCount)
  112. #define NTM_GET_KERNPAIR(pNTM) (MK_PTR(pNTM, dwKernPairOffset))
  113. #define NTM_GET_CHARDEFTBL(pNTM) (MK_PTR(pNTM, dwCharDefFlagOffset))
  114. #define NTM_GET_CHARSET(pNTM) (pNTM->dwCharSet)
  115. #define NTM_GET_CODEPAGE(pNTM) (pNTM->dwCodePage)
  116. #define NTM_GET_ETM(pNTM) (pNTM->etm)
  117. #define CH_DEF(gi) (1 << ((gi) % 8))
  118. #define CH_DEF_INDEX(gi) ((gi) / 8)
  119. #define NTM_CHAR_DEFINED(pNTM, gi) \
  120. (((PBYTE)MK_PTR((pNTM), dwCharDefFlagOffset))[CH_DEF_INDEX(gi)] & CH_DEF(gi))
  121. typedef struct _WIDTHRUN {
  122. WORD wStartGlyph; // glyph handle of the first glyph
  123. WORD wGlyphCount; // number of glyphs covered
  124. DWORD dwCharWidth; // glyph width
  125. } WIDTHRUN, *PWIDTHRUN;
  126. #define WIDTHRUN_COMPLEX 0x80000000
  127. #endif //!_PSNTM_H_