Source code of Windows XP (NT5)
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.

172 lines
5.3 KiB

  1. /*++
  2. Copyright (c) 1996 - 1999 Microsoft Corporation
  3. Module Name:
  4. fmoldmf.h
  5. Abstract:
  6. NT4.0 Font metrics file format.
  7. Structures used to determine the file layout of files generated
  8. by any font installers, and then read by us.
  9. Environment:
  10. Windows NT printer drivers
  11. Revision History:
  12. 11/11/96 -eigos-
  13. From NT4.0 header file.
  14. mm/dd/yy -eigos-
  15. Description
  16. --*/
  17. //
  18. // Define the structure that heads each record in the font installer
  19. // files. Basically it contains selection information and offsets
  20. // to the remaining data in this record.
  21. // This structure is actually written to the file. It is also the header
  22. // employed in the font resources in minidrivers - each font has one of these
  23. // at the beginning.
  24. //
  25. //
  26. // Reduced from 4 to three as WFontType is added.
  27. // Reducde from three to two when dwETM was added
  28. //
  29. #define EXP_SIZE 2 // DWORDS allowed for future expansion
  30. //
  31. // Font installer header.
  32. //
  33. typedef struct
  34. {
  35. WORD cjThis; // Our size, for consistency checking
  36. WORD wFlags; // Miscellaneous information
  37. DWORD dwSelBits; // Font availability information
  38. DWORD dwIFIMet; // Offset to the IFIMETRICS for this font
  39. DWORD dwCDSelect; // How to select/deselect this fontg
  40. DWORD dwCDDeselect;
  41. DWORD dwWidthTab; // Width vector (proportional font) else 0g
  42. DWORD dwIdentStr; // Identification stringg
  43. union
  44. {
  45. short sCTTid; // Index into CTT datag
  46. DWORD dwCTT; // Offset here to mapping data of some sortg
  47. } u;
  48. WORD wXRes; // Resolution used for font metrics numbersg
  49. WORD wYRes; // Ditto for the y coordinatesg
  50. short sYAdjust; // Adjust Y position before output - for g
  51. // double height characters on dot matrixg
  52. short sYMoved; // Cursor has shifted after printing fontg
  53. short fCaps; // Capabilities flagsg
  54. WORD wPrivateData; // Special purpose: e.g. DeskJet permutationsg
  55. WORD wFontType; // Type of Device fontg
  56. WORD wReserved; // reserved for future useg
  57. DWORD dwETM; // offset to ETM for this font. Could be NULL.
  58. DWORD dwMBZ[ EXP_SIZE ]; // Must Be Zero: in case we need spaceg
  59. } FI_DATA_HEADER;
  60. //
  61. // The version ID.
  62. //
  63. #define FDH_VER 0x100 // 1.00 in BCD
  64. //
  65. // Flags bits.
  66. //
  67. #define FDH_SOFT 0x0001 // Softfont, thus needs downloadingg
  68. #define FDH_CART 0x0002 // This is a cartridge fontg
  69. #define FDH_CART_MAIN 0x0004 // Main (first) entry for this cartridgeg
  70. //
  71. // Selection criteria bits: dwSelBits. These bits are used as
  72. // follows. During font installation, the installer set the following
  73. // values as appropriate. During initialisation, the driver sets
  74. // up a mask of these bits, depending upon the printer's abilities.
  75. // For example, the FDH_SCALABLE bit is set only if the printer can
  76. // handle scalable fonts. When the fonts are examined to see if
  77. // they are usable, the following test is applied:
  78. //
  79. // (font.dwSelBits & printer.dwSelBits) == font.dwSelBits
  80. //
  81. // If true, the font is usable.
  82. //
  83. #define FDH_LANDSCAPE 0x00000001 // Font is landscape orientationg
  84. #define FDH_PORTRAIT 0x00000002 // Font is portraitg
  85. #define FDH_OR_REVERSE 0x00000004 // 180 degree rotation of aboveg
  86. #define FDH_BITMAP 0x00000008 // Bitmap fontg
  87. #define FDH_COMPRESSED 0x00000010 // Data is compressed bitmapg
  88. #define FDH_SCALABLE 0x00000020 // Font is scalableg
  89. #define FDH_CONTOUR 0x00000040 // Intellifont contourg
  90. #define FDH_ERROR 0x80000000 // Set if some error conditiong
  91. //
  92. // The following structure should be returned from the specific
  93. // minidriver to the common font installer code. It is used by
  94. // the common font installer code to generate the above structure
  95. // which is then placed in the font file.
  96. //
  97. typedef struct _DATA_SUM
  98. {
  99. void *pvData; // Address of data of importanceg
  100. int cBytes; // Number of bytes in the aboveg
  101. } DATA_SUM;
  102. //
  103. // Font file header.
  104. //
  105. typedef struct _FI_DATA
  106. {
  107. DATA_SUM dsIFIMet; // IFIMETRICS
  108. DATA_SUM dsSel; // Selection string/whatever
  109. DATA_SUM dsDesel; // Deselection string
  110. DATA_SUM dsWidthTab; // Width tables (proportional font)
  111. DATA_SUM dsCTT; // Translation data
  112. DATA_SUM dsIdentStr; // Identification string (Dialog box etc)
  113. DATA_SUM dsETM; // EXTENDED TEXT METRICS
  114. DWORD dwSelBits; // Font availability information
  115. WORD wVersion; // Version ID
  116. WORD wFlags; // Miscellaneous information
  117. WORD wXRes; // X resolution of font
  118. WORD wYRes; // Y resolution
  119. short sYAdjust; // Adjust Y position before output - for
  120. // double height characters on dot matrix
  121. short sYMoved; // Cursor has shifted after printing font
  122. WORD fCaps; // Font/device caps
  123. WORD wFontType; // Type of Device font
  124. WORD wPrivateData; // Pad to DWORD multiple
  125. } FI_DATA;