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.

159 lines
5.8 KiB

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