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.

235 lines
8.8 KiB

  1. /*++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name:
  4. FontPdev.h
  5. Abstract:
  6. Unidrv FONTPDEV and related infor header file.
  7. Environment:
  8. Windows NT Unidrv driver
  9. Revision History:
  10. 11/06/96 -ganeshp-
  11. Created
  12. dd-mm-yy -author-
  13. description
  14. --*/
  15. #ifndef _FONTPDEV_H_
  16. #define _FONTPDEV_H_
  17. //
  18. // FONTCTL is included in FONTPDEV for controlling the state device.
  19. //
  20. typedef struct _FONTCTL
  21. {
  22. DWORD dwAttrFlags; // Font attribute flags, italic/bold.
  23. INT iFont; // Font index; -ve for downloaded GDI font
  24. INT iSoftFont; // Soft Font index;
  25. INT iRotate; // Font Rotation Angle
  26. POINTL ptlScale; // Printer sizes for scalable fonts
  27. FLOATOBJ eXScale; // Font scaling in baseline direction
  28. FLOATOBJ eYScale; // Font scaling in the ascender direction
  29. PFONTMAP pfm;
  30. } FONTCTL;
  31. //
  32. // dwAttrFlags
  33. //
  34. #define FONTATTR_BOLD 0x00000001
  35. #define FONTATTR_ITALIC 0x00000002
  36. #define FONTATTR_UNDERLINE 0x00000004
  37. #define FONTATTR_STRIKEOUT 0x00000008
  38. #define FONTATTR_SUBSTFONT 0x10000000
  39. #define INVALID_FONT 0x7FFFFFFF // for iFont.
  40. //
  41. // Font Cartridges definitions.
  42. //
  43. #define MAXCARTNAMELEN 64
  44. //
  45. // Font cart mapping table. This table is a list of names and correponding
  46. // FONTCAT structure which is filled by the parser. The actual font list
  47. // is in the FONTCART structure.
  48. //
  49. typedef struct _FONTCARTMAP
  50. {
  51. PFONTCART pFontCart; //Pointer to fontcart in GPD.
  52. WCHAR awchFontCartName[MAXCARTNAMELEN]; /* Name of the Font Cart*/
  53. BOOL bInstalled; //This Font Cartridges is installed or not
  54. } FONTCARTMAP, *PFONTCARTMAP;
  55. //
  56. // This structure is stored in the FontPDEV and has all the information about
  57. // Font cartridges.
  58. //
  59. typedef struct _FONTCARTINFO
  60. {
  61. PFONTCARTMAP pFontCartMap; // Font Cartridge Mapping Table.
  62. INT iNumAllFontCarts; // Number of all supported font carts.
  63. INT iNumInstalledCarts; // Number of installed cartridges.
  64. DWORD dwFontCartSlots; // Number of Font Cartridge Slots.
  65. }FONTCARTINFO, *PFONTCARTINFO;
  66. //
  67. // This structe stores the Font resource ids of all the preinstalled fonts.
  68. // This include Resident fonts plus installed Cartridge specific fonts.
  69. //
  70. typedef struct _FONTLIST_
  71. {
  72. PDWORD pdwList; // An array of device font resource Ids.
  73. INT iEntriesCt; // Number of valid entries.
  74. INT iMaxEntriesCt; // Max number of Entries in this list
  75. } FONTLIST, *PFONTLIST;
  76. //
  77. // FONTPDEV structure
  78. //
  79. typedef struct _FONTPDEV {
  80. DWORD dwSignature; // FONTPDEV Signature
  81. DWORD dwSize; // FONTPDEV Size.
  82. PDEV *pPDev; // Pointer to PDEV.
  83. DWORD flFlags; // General Flags.
  84. DWORD flText; // Text Capabilities.
  85. DWORD dwFontMem; // Bytes of allocated printer memory
  86. // for font download
  87. DWORD dwFontMemUsed; // Bytes of printer memory used for
  88. // downloaded fonts
  89. DWORD dwSelBits; // Font selection bits
  90. POINT ptTextScale; // relationship between master units
  91. // and text units.
  92. INT iUsedSoftFonts; // Number of soft fonts used
  93. INT iNextSFIndex; // Index ID to use for next softfont
  94. INT iFirstSFIndex; // Value used to reset the above
  95. INT iLastSFIndex; // Largest value available
  96. INT iMaxSoftFonts; // Maximum number of Soft font per page
  97. INT iDevResFontsCt; // Num of device resident fonts.
  98. // No cartridge fonts: No soft fonts.
  99. INT iDevFontsCt; // Num of device fonts including cartridge
  100. // fonts: no soft fonts.'cBIFonts' in Rasdd
  101. INT iSoftFontsCt; // Number of SoftFonts installed.
  102. INT iCurXFont; // Index of currently selected softfont
  103. INT iWhiteIndex; // White index of the device palette
  104. INT iBlackIndex; // Black index of the device palette
  105. DWORD dwDefaultFont; // Default font
  106. SHORT sDefCTT; // Default translation table
  107. WORD wReserved; // Padding
  108. DWORD dwTTYCodePage; // Default codepage for TTY
  109. SURFOBJ *pso; // SurfObj access
  110. PVOID pPSHeader; // Position sorting header (posnsort.[hc])
  111. PVOID pvWhiteTextFirst; // Pointer to first in the White text list, if needed
  112. PVOID pvWhiteTextLast; // Pointer to the last in the White text list
  113. PVOID pTTFile; // True Type File pointer
  114. ULONG pcjTTFile; // size of True Type File
  115. PVOID ptod; // For access to TextOut Data.
  116. FONTMAP *pFontMap; // Array of FONTMAPS describing fonts.
  117. FONTMAP *pFMDefault; // Default font FONTMAP, if != 0
  118. PVOID pvDLMap; // Mapping of GDI to downloaded info
  119. FONTLIST FontList; // This is array of font resource ids of
  120. // Device and precompiled Cartridges fonts.
  121. FONTCARTINFO FontCartInfo; // This is array of font Cartridges.
  122. FONTCTL ctl; // Font state of the printer.
  123. IFIMETRICS *pIFI; // Current font IFIMETRICS cache.
  124. PFLOATOBJ_XFORM pxform; // Current font XFORM
  125. HANDLE hUFFFile;
  126. //
  127. // Font attribute command cache
  128. PCOMMAND pCmdBoldOn;
  129. PCOMMAND pCmdBoldOff;
  130. PCOMMAND pCmdItalicOn;
  131. PCOMMAND pCmdItalicOff;
  132. PCOMMAND pCmdUnderlineOn;
  133. PCOMMAND pCmdUnderlineOff;
  134. PCOMMAND pCmdClearAllFontAttribs;
  135. //
  136. // Font substitution table in registry.
  137. //
  138. TTSUBST_TABLE pTTFontSubReg; // Font substitution table.
  139. //
  140. // Font module callback interface object
  141. //
  142. PI_UNIFONTOBJ pUFObj;
  143. } FONTPDEV, *PFONTPDEV;
  144. //
  145. //General MACROes
  146. //
  147. #define FONTPDEV_ID 'VDPF' //"FPDV" in ASCII.
  148. #define FONTMAP_ID 'PAMF' //"FMAP" in ASCII.
  149. #define MAXDEVFONT 255 // Maximum number of font entris in a
  150. // List. There may be more than one
  151. // LIST to repesent all the fonts.
  152. //
  153. // FONTPDEV.flflags Values
  154. //
  155. #define FDV_ROTATE_FONT_ABLE 0x00000001 // Font can be rotated
  156. #define FDV_ALIGN_BASELINE 0x00000002 // Text is Base Line aligned
  157. #define FDV_TT_FS_ENABLED 0x00000004 // Text is Base Line aligned
  158. #define FDV_DL_INCREMENTAL 0x00000008 // always TRUE
  159. #define FDV_TRACK_FONT_MEM 0x00000010 // Track Memory for font DL
  160. #define FDV_WHITE_TEXT 0x00000020 // Can print white text
  161. #define FDV_DLTT 0x00000040 // Download True Type
  162. #define FDV_DLTT_ASTT_PREF 0x00000080 // True Type as outline
  163. #define FDV_DLTT_BITM_PREF 0x00000100 // True Type as Bitmap
  164. #define FDV_DLTT_OEMCALLBACK 0x00000200 // True Type as Bitmap
  165. #define FDV_MD_SERIAL 0x00000400 // Printer is a serial printer
  166. #define FDV_GRX_ON_TXT_BAND 0x00000800 // Grx is drawn on Text Band
  167. #define FDV_GRX_UNDER_TEXT 0x00001000 // Grx is drawn under Text
  168. #define FDV_BKSP_OK 0x00002000 // use BkSpace to overstrike
  169. #define FDV_90DEG_ROTATION 0x00004000 // Supports 90 Deg Rot.
  170. #define FDV_ANYDEG_ROTATION 0x00008000 // Supports Any Deg Rot.
  171. #define FDV_SUPPORTS_FGCOLOR 0x00010000 // Supports Foreground color.
  172. #define FDV_SUBSTITUTE_TT 0x00020000 // Substitute TT font.
  173. #define FDV_SET_FONTID 0x00040000 // Soft font ID command is sent
  174. #define FDV_UNDERLINE 0x00080000 // Device can simlulate underline
  175. #define FDV_INIT_ATTRIB_CMD 0x00100000 // Initalized font attribute cmd
  176. #define FDV_SINGLE_BYTE 0x00200000 // ESC/P Single/Double byte mode flag
  177. #define FDV_DOUBLE_BYTE 0x00400000 // ESC/P Single/Double byte mode flag
  178. #define FDV_DISABLE_POS_OPTIMIZE 0x00800000 // Disable X position optimization
  179. #define FDV_ENABLE_PARTIALCLIP 0x01000000 // Enable partial clipping
  180. //
  181. // Misc macros
  182. // A macro to swap bytes in words. Needed as PCL structures are in
  183. // 68k big endian format.
  184. //
  185. #define SWAB( x ) ((WORD)(x) = (WORD)((((x) >> 8) & 0xff) | (((x) << 8) & 0xff00)))
  186. #endif // !_FONTPDEV_H_