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.

226 lines
6.9 KiB

  1. /*++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name:
  4. fmnewfm.h
  5. Abstract:
  6. Universal printer driver specific font metrics resource header
  7. Environment:
  8. Windows NT printer drivers
  9. Revision History:
  10. 10/30/96 -eigos-
  11. Created it.
  12. --*/
  13. #ifndef _FMNEWFM_H_
  14. #define _FMNEWFM_H_
  15. //
  16. // NOTE: To include this header file, it is necessary to include
  17. // parser.h which has a definition of INVOCATION structure,
  18. // winddi.h which has a definition of IFIMETRICS, FD_KERNINGPAIR
  19. //
  20. //
  21. //
  22. // UNIFM
  23. //
  24. // Universal printer driver (UNIDRV) font file header.
  25. //
  26. #define UNIFM_VERSION_1_0 0x00010000
  27. typedef struct _UNIFM_HDR
  28. {
  29. DWORD dwSize; // a total size of this font file
  30. DWORD dwVersion; // a version number of this font file
  31. ULONG ulDefaultCodepage; // this font's default codepage
  32. LONG lGlyphSetDataRCID; // a resource ID of GLYPHDATA
  33. DWORD loUnidrvInfo; // offset to UNIDRVINFO
  34. DWORD loIFIMetrics; // offset to IFIMETRICS
  35. DWORD loExtTextMetric; // offset to EXTTEXTMETRIC
  36. DWORD loWidthTable; // offset to WIDTHTABLE
  37. DWORD loKernPair; // offset to KERNPAIR
  38. DWORD dwReserved[2];
  39. } UNIFM_HDR, *PUNIFM_HDR;
  40. #define GET_UNIDRVINFO(pUFM) \
  41. ((PUNIDRVINFO)((PBYTE)(pUFM) + (pUFM)->loUnidrvInfo))
  42. #define GET_IFIMETRICS(pUFM) \
  43. ((IFIMETRICS*)((PBYTE)(pUFM) + (pUFM)->loIFIMetrics))
  44. #define GET_EXTTEXTMETRIC(pUFM) \
  45. ((EXTTEXTMETRIC*)((PBYTE)(pUFM) + (pUFM)->loExtTextMetric))
  46. #define GET_WIDTHTABLE(pUFM) \
  47. ((PWIDTHTABLE)((PBYTE)(pUFM) + (pUFM)->loWidthTable))
  48. #define GET_KERNDATA(pUFM) \
  49. ((PKERNDATA)((PBYTE)(pUFM) + (pUFM)->loKernPair))
  50. //
  51. // UNIDRVINFO
  52. //
  53. // UNIDRVINFO is used to define printer specific information.
  54. //
  55. typedef struct _UNIDRVINFO
  56. {
  57. DWORD dwSize;
  58. DWORD flGenFlags;
  59. WORD wType;
  60. WORD fCaps;
  61. WORD wXRes;
  62. WORD wYRes;
  63. short sYAdjust;
  64. short sYMoved;
  65. WORD wPrivateData;
  66. short sShift;
  67. INVOCATION SelectFont;
  68. INVOCATION UnSelectFont;
  69. WORD wReserved[4];
  70. } UNIDRVINFO, *PUNIDRVINFO;
  71. #define GET_SELECT_CMD(pUni) \
  72. ((PCHAR)(pUni) + (pUni)->SelectFont.loOffset)
  73. #define GET_UNSELECT_CMD(pUni) \
  74. ((PCHAR)(pUni) + (pUni)->UnSelectFont.loOffset)
  75. //
  76. // flGenFlags
  77. //
  78. #define UFM_SOFT 0x00000001 // Softfont, thus needs downloading
  79. #define UFM_CART 0x00000002 // This is a cartridge font
  80. #define UFM_SCALABLE 0x00000004 // Font is scalable
  81. //
  82. // wType
  83. //
  84. #define DF_TYPE_HPINTELLIFONT 0 // HP's Intellifont
  85. #define DF_TYPE_TRUETYPE 1 // HP's PCLETTO fonts on LJ4
  86. #define DF_TYPE_PST1 2 // Lexmark PPDS scalable fonts
  87. #define DF_TYPE_CAPSL 3 // Canon CAPSL scalable fonts
  88. #define DF_TYPE_OEM1 4 // OEM scalable font type 1
  89. #define DF_TYPE_OEM2 5 // OEM scalable font type 2
  90. //
  91. // fCaps
  92. //
  93. #define DF_NOITALIC 0x0001 // Cannot italicize via FONTSIMULATION
  94. #define DF_NOUNDER 0x0002 // Cannot underline via FONTSIMULATION
  95. #define DF_XM_CR 0x0004 // send CR after using this font
  96. #define DF_NO_BOLD 0x0008 // Cannot bold via FONTSIMULATION
  97. #define DF_NO_DOUBLE_UNDERLINE 0x0010 // Cannot double underline via
  98. // FONTSIMU ATION
  99. #define DF_NO_STRIKETHRU 0x0020 // Cannot strikethru via FONTSIMULATION
  100. #define DF_BKSP_OK 0x0040 // Can use backspace char, see spec
  101. // for details
  102. //
  103. // EXTTEXTMETRIC
  104. //
  105. // The EXTTEXTMETRIC structure provides extended-metric information for a font.
  106. // All the measurements are given in the specified units,
  107. // regardless of the current mapping mode of the display context.
  108. //
  109. #ifndef _EXTTEXTMETRIC_
  110. #define _EXTTEXTMETRIC_
  111. typedef struct _EXTTEXTMETRIC
  112. {
  113. short emSize;
  114. short emPointSize;
  115. short emOrientation;
  116. short emMasterHeight;
  117. short emMinScale;
  118. short emMaxScale;
  119. short emMasterUnits;
  120. short emCapHeight;
  121. short emXHeight;
  122. short emLowerCaseAscent;
  123. short emLowerCaseDescent;
  124. short emSlant;
  125. short emSuperScript;
  126. short emSubScript;
  127. short emSuperScriptSize;
  128. short emSubScriptSize;
  129. short emUnderlineOffset;
  130. short emUnderlineWidth;
  131. short emDoubleUpperUnderlineOffset;
  132. short emDoubleLowerUnderlineOffset;
  133. short emDoubleUpperUnderlineWidth;
  134. short emDoubleLowerUnderlineWidth;
  135. short emStrikeOutOffset;
  136. short emStrikeOutWidth;
  137. WORD emKernPairs;
  138. WORD emKernTracks;
  139. } EXTTEXTMETRIC, *PEXTTEXTMETRIC;
  140. #endif // _EXTTEXTMETRIC_
  141. //
  142. // WIDTHTABLE
  143. //
  144. // This data structure represents the character width table.
  145. // This width table is a continuous GLYPHHANDLE base,
  146. // not Unicode nor codepage/character code base.
  147. // GLYPHANDLE information is in the GLYPHDATA.
  148. //
  149. typedef struct _WIDTHRUN
  150. {
  151. WORD wStartGlyph; // index of the first glyph handle
  152. WORD wGlyphCount; // number of glyphs covered
  153. DWORD loCharWidthOffset; // glyph width table
  154. } WIDTHRUN, *PWIDTHRUN;
  155. typedef struct _WIDTHTABLE
  156. {
  157. DWORD dwSize; // the size of this structure including every run
  158. DWORD dwRunNum; // the number of widthrun
  159. WIDTHRUN WidthRun[1]; // width run array
  160. } WIDTHTABLE, *PWIDTHTABLE;
  161. //
  162. // The array has wGlyphCount elements and each element is the char width
  163. // for a single glyph. The first width corresponds to glyph index wStartGlyph
  164. // and so on. The byte offset is relative to the beginning of WIDTHTABLE
  165. // structure and must be WORD-aligned.
  166. // In case of Western device font, proportional font has all varibal pitch
  167. // characters. This means that dwRunNum is set to 1 and loCharWidthOffset
  168. // would be an offset from the top of WIDTHTABLE to a width vector of all
  169. // characters.
  170. // In case of Far Eastern device font, basically IFIMETRICS.fwdAveCharWidth and
  171. // IFIMETRICS.fwdMaxCharWidth are used for single byte and double byte character
  172. // width. If a font is proportional, a UFM has a WIDTHTABLE which represents
  173. // only the proportional pitch characters. Other characters use fdwAveCharWidth
  174. // and fwdMaxCharInc for single and double byte characters.
  175. //
  176. //
  177. // KERNDATA
  178. // This data structure represents kerning pair information.
  179. // This kerning pair table is a Unicode base.
  180. //
  181. typedef struct _KERNDATA
  182. {
  183. DWORD dwSize; // the size of this structure including array
  184. DWORD dwKernPairNum; // the number of kerning pair
  185. FD_KERNINGPAIR KernPair[1]; // FD_KERNINGPAIR array
  186. } KERNDATA, *PKERNDATA;
  187. #endif //_FMNEWFM_H_