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.

335 lines
9.4 KiB

  1. // *------------------------------------------------------------------------*
  2. // * makepfm.h
  3. // *------------------------------------------------------------------------*
  4. //
  5. // Copyright 1990, 1991 -- Adobe Systems, Inc.
  6. // PostScript is a trademark of Adobe Systems, Inc.
  7. //
  8. // NOTICE: All information contained herein or attendant hereto is, and
  9. // remains, the property of Adobe Systems, Inc. Many of the intellectual
  10. // and technical concepts contained herein are proprietary to Adobe Systems,
  11. // Inc. and may be covered by U.S. and Foreign Patents or Patents Pending or
  12. // are protected as trade secrets. Any dissemination of this information or
  13. // reproduction of this material are strictly forbidden unless prior written
  14. // permission is obtained from Adobe Systems, Inc.
  15. //
  16. //---------------------------------------------------------------------------
  17. typedef char *LPSZ;
  18. #define OPEN FileOpen
  19. #define CLOSE _lclose
  20. #define READ_BLOCK _lread
  21. #define WRITE_BLOCK _lwrite
  22. #define STRCPY lstrcpy
  23. #define STRCAT lstrcat
  24. #define STRCMP lstrcmp
  25. /*--------------------------------------------------------------------------*/
  26. #define DEBUG_MODE 0
  27. typedef struct { /* A lookup table for converting strings to tokens */
  28. char *szKey; /* Ptr to the string */
  29. int iValue; /* The corresponding token value */
  30. } KEY;
  31. #define TK_UNDEFINED 0 /* tokens for ReadFontInfo */
  32. #define TK_EOF 1
  33. #define TK_MSMENUNAME 2
  34. #define TK_VPSTYLE 3
  35. #define TK_PI 4
  36. #define TK_SERIF 5
  37. #define TK_PCLSTYLE 6
  38. #define TK_PCLSTROKEWEIGHT 7
  39. #define TK_PCLTYPEFACEID 8
  40. #define TK_INF_CAPHEIGHT 9
  41. #define LAST_FI_TOKEN 9
  42. #define TK_ANGLE 10 // added for ATM ( GetINFFontDescription )
  43. #define TK_PSNAME 11 // added for ATM ( GetINFFontDescription )
  44. /*----------------------------------------------------------------------------*/
  45. /* EM describes the basic character cell dimension (in Adobe units) */
  46. #define EM 1000
  47. /*----------------------------------------------------------------------------*/
  48. #define ANSI_CHARSET 0
  49. #define SYMBOL_CHARSET 2
  50. #define OEM_CHARSET 255
  51. #define PCL_PI_CHARSET 181
  52. #define PS_FONTTYPE 0x0081
  53. #define PCL_FONTTYPE 0x0080
  54. #define FW_NORMAL 400
  55. #define FW_BOLD 700
  56. /* GDI font families. */
  57. #define WIN30
  58. #ifdef WIN30
  59. #define FF_DONTCARE (0<<4) /* Don't care or don't know. */
  60. #define FF_ROMAN (1<<4) /* Variable stroke width, serifed. Times Roman, Century Schoolbook, etc. */
  61. #define FF_SWISS (2<<4) /* Variable stroke width, sans-serifed. Helvetica, Swiss, etc. */
  62. #define FF_MODERN (3<<4) /* Const stroke width, serifed or sans-serifed. Pica, Elite, Courier, etc. */
  63. #define FF_SCRIPT (4<<4) /* Cursive, etc. */
  64. #define FF_DECORATIVE (5<<4) /* Old English, etc. */
  65. #endif
  66. typedef struct
  67. {
  68. SHORT left;
  69. SHORT bottom;
  70. SHORT right;
  71. SHORT top;
  72. } BBOX;
  73. typedef struct {
  74. SHORT capHeight;
  75. SHORT xHeight;
  76. SHORT loAscent; /* Lower-case ascent */
  77. SHORT loDescent; /* Lower-case descent */
  78. SHORT ulOffset; /* The underline offset */
  79. SHORT ulThick; /* The underline thickness */
  80. SHORT iSlant; /* The italic angle */
  81. BBOX rcBounds; /* The font bounding box */
  82. } EMM;
  83. typedef struct {
  84. char szFont[32]; /* The PostScript font name */
  85. char szFace[32]; /* The face name of the font */
  86. BOOL fEnumerate; /* TRUE if the font should be enumerated */
  87. BOOL fItalic; /* TRUE if this is an italic font */
  88. BOOL fSymbol; /* TRUE if the font is decorative */
  89. SHORT iFamily; /* The fonts family */
  90. WORD iWeight; /* TRUE if this is a bold font */
  91. SHORT iFirstChar; /* The first character in the font */
  92. SHORT iLastChar; /* The last character in the font */
  93. SHORT rgWidths[256]; /* Character widths from 0x020 to 0x0ff */
  94. } FONT;
  95. extern void PutByte(SHORT);
  96. extern void PutWord(SHORT);
  97. extern void PutLong(long);
  98. typedef struct
  99. {
  100. WORD iKey;
  101. SHORT iKernAmount;
  102. } KX, *PKX;
  103. typedef struct
  104. {
  105. WORD cPairs; /* The number of kerning pairs */
  106. PKX rgPairs;
  107. } KP;
  108. /* The info for a single kern track */
  109. typedef struct
  110. {
  111. SHORT iDegree; /* The degree of kerning */
  112. SHORT iPtMin; /* The minimum point size */
  113. SHORT iKernMin; /* The minimum kern amount */
  114. SHORT iPtMax; /* The maximum point size */
  115. SHORT iKernMax; /* The maximum kern amount */
  116. } TRACK;
  117. #define MAXTRACKS 16
  118. /* The track kerning table for a font */
  119. typedef struct
  120. {
  121. SHORT cTracks; /* The number of kern tracks */
  122. TRACK rgTracks[MAXTRACKS]; /* The kern track information */
  123. } KT;
  124. /* Character metrics */
  125. typedef struct
  126. {
  127. BBOX rc;
  128. SHORT iWidth;
  129. } CM;
  130. typedef struct
  131. {
  132. WORD iPtSize;
  133. SHORT iFirstChar;
  134. SHORT iLastChar;
  135. SHORT iAvgWidth;
  136. SHORT iMaxWidth;
  137. SHORT iItalicAngle;
  138. SHORT iFamily;
  139. SHORT ulOffset;
  140. SHORT ulThick;
  141. SHORT iAscent;
  142. SHORT iDescent;
  143. BOOL fVariablePitch;
  144. BOOL fWasVariablePitch;
  145. char szFile[MAX_PATH + 4]; // +1 for nul term, +3 for alignment.
  146. char szFont[80];
  147. char szFace[80];
  148. SHORT iWeight;
  149. KP kp;
  150. KT kt;
  151. BBOX rcBBox;
  152. CM rgcm[256]; /* The character metrics */
  153. } AFM;
  154. /*----------------------------------------------------------------------------*/
  155. typedef struct
  156. {
  157. SHORT iSize;
  158. SHORT iPointSize;
  159. SHORT iOrientation;
  160. SHORT iMasterHeight;
  161. SHORT iMinScale;
  162. SHORT iMaxScale;
  163. SHORT iMasterUnits;
  164. SHORT iCapHeight;
  165. SHORT iXHeight;
  166. SHORT iLowerCaseAscent;
  167. SHORT iLowerCaseDescent;
  168. SHORT iSlant;
  169. SHORT iSuperScript;
  170. SHORT iSubScript;
  171. SHORT iSuperScriptSize;
  172. SHORT iSubScriptSize;
  173. SHORT iUnderlineOffset;
  174. SHORT iUnderlineWidth;
  175. SHORT iDoubleUpperUnderlineOffset;
  176. SHORT iDoubleLowerUnderlineOffset;
  177. SHORT iDoubleUpperUnderlineWidth;
  178. SHORT iDoubleLowerUnderlineWidth;
  179. SHORT iStrikeOutOffset;
  180. SHORT iStrikeOutWidth;
  181. WORD nKernPairs;
  182. WORD nKernTracks;
  183. } ETM;
  184. /*----------------------------------------------------------------------------*/
  185. typedef struct
  186. {
  187. WORD iVersion;
  188. DWORD iSize;
  189. CHAR szCopyright[60];
  190. WORD iType;
  191. WORD iPoints;
  192. WORD iVertRes;
  193. WORD iHorizRes;
  194. WORD iAscent;
  195. WORD iInternalLeading;
  196. WORD iExternalLeading;
  197. BYTE iItalic;
  198. BYTE iUnderline;
  199. BYTE iStrikeOut;
  200. WORD iWeight;
  201. BYTE iCharSet;
  202. WORD iPixWidth;
  203. WORD iPixHeight;
  204. BYTE iPitchAndFamily;
  205. WORD iAvgWidth;
  206. WORD iMaxWidth;
  207. BYTE iFirstChar;
  208. BYTE iLastChar;
  209. BYTE iDefaultChar;
  210. BYTE iBreakChar;
  211. WORD iWidthBytes;
  212. DWORD oDevice;
  213. DWORD oFace;
  214. DWORD oBitsPointer;
  215. DWORD oBitsOffset;
  216. } PFM;
  217. typedef struct
  218. {
  219. WORD oSizeFields;
  220. DWORD oExtMetricsOffset;
  221. DWORD oExtentTable;
  222. DWORD oOriginTable;
  223. DWORD oPairKernTable;
  224. DWORD oTrackKernTable;
  225. DWORD oDriverInfo;
  226. DWORD iReserved;
  227. } PFMEXT;
  228. /*----------------------------------------------------------------------------*/
  229. typedef enum {
  230. epsymUserDefined,
  231. epsymRoman8,
  232. epsymKana8,
  233. epsymMath8,
  234. epsymUSASCII,
  235. epsymLineDraw,
  236. epsymMathSymbols,
  237. epsymUSLegal,
  238. epsymRomanExt,
  239. epsymISO_DenNor,
  240. epsymISO_UK,
  241. epsymISO_France,
  242. epsymISO_German,
  243. epsymISO_Italy,
  244. epsymISO_SwedFin,
  245. epsymISO_Spain,
  246. epsymGENERIC7,
  247. epsymGENERIC8,
  248. epsymECMA94
  249. } SYMBOLSET;
  250. typedef struct
  251. {
  252. SYMBOLSET symbolSet; /* kind of translation table */
  253. DWORD offset; /* location of user-defined table */
  254. WORD len; /* length (in bytes) of table */
  255. BYTE firstchar, lastchar; /* table ranges from firstchar to lastchar */
  256. } TRANSTABLE;
  257. typedef struct
  258. {
  259. WORD epSize; /* size of this data structure */
  260. WORD epVersion; /* number indicating version of struct */
  261. DWORD epMemUsage; /* amt of memory font takes up in printer */
  262. DWORD epEscape; /* pointer to escape that selects the font */
  263. TRANSTABLE xtbl; /* character set translation info */
  264. } DRIVERINFO;
  265. /*----------------------------------------------------------------------------*/
  266. #define POSTSCRIPT (1)
  267. #define PCL (2)
  268. /*----------------------------------------------------------------------------*/
  269. typedef enum { PORTRAIT, LANDSCAPE } ORIENTATION;
  270. #define ASCII_SET ("0U")
  271. #define ROMAN8_SET ("8U")
  272. #define WINANSI_SET ("9U")
  273. #define PI_SET ("15U")
  274. typedef struct
  275. {
  276. ORIENTATION orientation;
  277. char symbolsetStr[4];
  278. SYMBOLSET symbolsetNum;
  279. SHORT style;
  280. SHORT strokeWeight;
  281. SHORT typefaceLen;
  282. WORD typeface;
  283. char *epEscapeSequence; /* escape sequence that selects the font */
  284. } PCLINFO;
  285. /*--------------------------------------------------------------------------*/
  286. #define EOS '\0'
  287. /*--------------------------------------------------------------------------*/
  288. #define BUFFLEN 80
  289. #define MANDATORY 1
  290. #define CookedReadMode "r"
  291. #define FATALEXIT (2)
  292.