|
|
1.1 root 1: //--------------------------------------------------------------------------
2: //
3: // Module Name: PFM.H
4: //
5: // Brief Description: This module contains the PSCRIPT driver's
6: // font metrics defines.
7: //
8: // Author: Kent Settle (kentse)
9: // Created: 22-Jan-1991
10: //
11: // Copyright (C) 1991 - 1992 Microsoft Corporation.
12: //--------------------------------------------------------------------------
13:
14: #define MAX_STRING 80
15: #define MAX_KERNPAIRS 1024
16: #define MAX_CHARS 300
17:
18: #define ANSI_CHARSET 0
19: #define SYMBOL_CHARSET 2
20: #define OEM_CHARSET 255
21:
22: #define PFM_VERSION 0x00010000
23:
24: #define INIT_IFI 2048
25: #define INIT_PFM 131072 + INIT_IFI // storage to allocate to build NTFM.
26:
27: #define MIN_UNICODE_VALUE 0
28: #define MAX_UNICODE_VALUE 0xFFFE
29: #define INVALID_UNICODE_VALUE 0xFFFF
30: // The AFM tokens.
31:
32: #define TK_UNDEFINED 0
33: #define TK_STARTKERNDATA 2
34: #define TK_STARTKERNPAIRS 3
35: #define TK_KPX 4
36: #define TK_ENDKERNPAIRS 5
37: #define TK_ENDKERNDATA 6
38: #define TK_FONTNAME 7
39: #define TK_WEIGHT 8
40: #define TK_ITALICANGLE 9
41: #define TK_ISFIXEDPITCH 10
42: #define TK_UNDERLINEPOSITION 11
43: #define TK_UNDERLINETHICKNESS 12
44: #define TK_FONTBBOX 13
45: #define TK_CAPHEIGHT 14
46: #define TK_XHEIGHT 15
47: #define TK_DESCENDER 16
48: #define TK_ASCENDER 17
49: #define TK_STARTCHARMETRICS 18
50: #define TK_ENDCHARMETRICS 19
51: #define TK_ENDFONTMETRICS 20
52: #define TK_STARTFONTMETRICS 21
53: #define TK_ENCODINGSCHEME 22
54: #define TK_FULLNAME 23
55: #define TK_FAMILYNAME 24
56: #define TK_MSFAMILY 25
57:
58: // font defines.
59:
60: #define ARIAL 1
61: #define ARIAL_BOLD 2
62: #define ARIAL_BOLDOBLIQUE 3
63: #define ARIAL_OBLIQUE 4
64: #define ARIAL_NARROW 5
65: #define ARIAL_NARROW_BOLD 6
66: #define ARIAL_NARROW_BOLDOBLIQUE 7
67: #define ARIAL_NARROW_OBLIQUE 8
68: #define AVANTGARDE_BOOK 9
69: #define AVANTGARDE_BOOKOBLIQUE 10
70: #define AVANTGARDE_DEMI 11
71: #define AVANTGARDE_DEMIOBLIQUE 12
72: #define BOOKMAN_DEMI 13
73: #define BOOKMAN_DEMIITALIC 14
74: #define BOOKMAN_LIGHT 15
75: #define BOOKMAN_LIGHTITALIC 16
76: #define COURIER 17
77: #define COURIER_BOLD 18
78: #define COURIER_BOLDOBLIQUE 19
79: #define COURIER_OBLIQUE 20
80: #define GARAMOND_BOLD 21
81: #define GARAMOND_BOLDITALIC 22
82: #define GARAMOND_LIGHT 23
83: #define GARAMOND_LIGHTITALIC 24
84: #define HELVETICA 25
85: #define HELVETICA_BLACK 26
86: #define HELVETICA_BLACKOBLIQUE 27
87: #define HELVETICA_BOLD 28
88: #define HELVETICA_BOLDOBLIQUE 29
89: #define HELVETICA_CONDENSED 30
90: #define HELVETICA_CONDENSED_BOLD 31
91: #define HELVETICA_CONDENSED_BOLDOBL 32
92: #define HELVETICA_CONDENSED_OBLIQUE 33
93: #define HELVETICA_LIGHT 34
94: #define HELVETICA_LIGHTOBLIQUE 35
95: #define HELVETICA_NARROW 36
96: #define HELVETICA_NARROW_BOLD 37
97: #define HELVETICA_NARROW_BOLDOBLIQUE 38
98: #define HELVETICA_NARROW_OBLIQUE 39
99: #define HELVETICA_OBLIQUE 40
100: #define KORINNA_BOLD 41
101: #define KORINNA_KURSIVBOLD 42
102: #define KORINNA_KURSIVREGULAR 43
103: #define KORINNA_REGULAR 44
104: #define LUBALINGRAPH_BOOK 45
105: #define LUBALINGRAPH_BOOKOBLIQUE 46
106: #define LUBALINGRAPH_DEMI 47
107: #define LUBALINGRAPH_DEMIOBLIQUE 48
108: #define NEWCENTURYSCHLBK_BOLD 49
109: #define NEWCENTURYSCHLBK_BOLDITALIC 50
110: #define NEWCENTURYSCHLBK_ITALIC 51
111: #define NEWCENTURYSCHLBK_ROMAN 52
112: #define PALATINO_BOLD 53
113: #define PALATINO_BOLDITALIC 54
114: #define PALATINO_ITALIC 55
115: #define PALATINO_ROMAN 56
116: #define SOUVENIR_DEMI 57
117: #define SOUVENIR_DEMIITALIC 58
118: #define SOUVENIR_LIGHT 59
119: #define SOUVENIR_LIGHTITALIC 60
120: #define SYMBOL 61
121: #define TIMES_BOLD 62
122: #define TIMES_BOLDITALIC 63
123: #define TIMES_ITALIC 64
124: #define TIMES_ROMAN 65
125: #define TIMES_NEW_ROMAN 66
126: #define TIMES_NEW_ROMAN_BOLD 67
127: #define TIMES_NEW_ROMAN_BOLDITALIC 68
128: #define TIMES_NEW_ROMAN_ITALIC 69
129: #define VARITIMES_BOLD 70
130: #define VARITIMES_BOLDITALIC 71
131: #define VARITIMES_ITALIC 72
132: #define VARITIMES_ROMAN 73
133: #define ZAPFCALLIGRAPHIC_BOLD 74
134: #define ZAPFCALLIGRAPHIC_BOLDITALIC 75
135: #define ZAPFCALLIGRAPHIC_ITALIC 76
136: #define ZAPFCALLIGRAPHIC_ROMAN 77
137: #define ZAPFCHANCERY_MEDIUMITALIC 78
138: #define ZAPFDINGBATS 79
139:
140: #define FIRST_FONT 1
141: #define DEFAULT_FONT COURIER
142: #define NUM_INTERNAL_FONTS 79
143:
144: extern PutByte(SHORT);
145: extern PutWord(SHORT);
146: extern PutLong(long);
147:
148: typedef USHORT SOFFSET; // short offset.
149:
150: #define DWORDALIGN(a) ((a + (sizeof(DWORD) - 1)) & ~(sizeof(DWORD) - 1))
151: #define WCHARALIGN(a) ((a + (sizeof(WCHAR) - 1)) & ~(sizeof(WCHAR) - 1))
152:
153: typedef struct
154: {
155: CHAR *pstrAdobeFace;
156: CHAR *pstrWinFace;
157: } WINFONTPAIR;
158:
159: typedef struct
160: {
161: SHORT left;
162: SHORT top;
163: SHORT right;
164: SHORT bottom;
165: } SRECT;
166:
167: // entry for each soft font.
168:
169: typedef struct
170: {
171: ULONG iFace; // identifier for this font.
172: PWSTR pwstrPFMFile; // pointer to .PFM filename for this font.
173: struct _SOFTFONTENTRY *psfePrev; // pointer to previout entry.
174: struct _SOFTFONTENTRY *psfeNext; // pointer to next SOFTFONTENTRY.
175: } SOFTFONTENTRY, *PSOFTFONTENTRY;
176:
177: // NT Font Metrics structure.
178:
179: typedef struct
180: {
181: ULONG cjThis; // size of this struct, with attached data.
182: ULONG ulVersion; // version of this structure.
183: ULONG cjSoftFont; // size of softfont data, if any.
184: RECT rcBBox; // bounding box of entire font.
185: FWORD fwdLowerCaseAscent;
186: LOFFSET loszFullName; // offset to FullName from top of struct.
187: LOFFSET loszFontName; // offset to FontName.
188: LOFFSET loszFamilyName; // offset to FamilyName.
189: ULONG cKernPairs;
190: LOFFSET loKernPairs; // offset to start of FD_KERNINGPAIR structs.
191: ULONG cCharacters;
192: LOFFSET loCharMetrics; // offset to array of USHORTS then BYTES.
193: LOFFSET loSoftFont; // offset to softfont code, if any, else NULL.
194: LOFFSET loIFIMETRICS; // offset to IFIMETRICS structure.
195: } NTFM, *PNTFM;
196:
197: // AFM to PFM compiler data structure.
198:
199: typedef struct _PARSEDATA
200: {
201: char rgbBuffer[2048]; // the input buffer.
202: int cbBuffer; // number bytes in buffer.
203: char *pbBuffer; // pointer to current location in buffer.
204: char rgbLine[160]; // The current line of text being processed
205: char *szLine; // Ptr to the current location in the line
206: BOOL fEOF;
207: BOOL fUnGetLine;
208: HANDLE hFile;
209: PNTFM pntfm;
210: IFIMETRICS *pTmpIFI;
211: int cbFullName;
212: int cbFontName;
213: int cbFamilyName;
214: char szTmpFullName[MAX_STRING];
215: char szTmpFontName[MAX_STRING];
216: char szTmpFamilyName[MAX_STRING];
217: FD_KERNINGPAIR TmpKernPairs[MAX_KERNPAIRS];
218: USHORT TmpCharWidths[MAX_CHARS];
219: BYTE TmpCharCodes[MAX_CHARS];
220: } PARSEDATA, *PPARSEDATA;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.