xref: /reactos/sdk/include/psdk/prntfont.h (revision c2c66aff)
1*c2c66affSColin Finck /*
2*c2c66affSColin Finck  * prntfont.h
3*c2c66affSColin Finck  *
4*c2c66affSColin Finck  * Declarations for Windows NT printer driver font metrics
5*c2c66affSColin Finck  *
6*c2c66affSColin Finck  * This file is part of the w32api package.
7*c2c66affSColin Finck  *
8*c2c66affSColin Finck  * Contributors:
9*c2c66affSColin Finck  *   Created by Filip Navara <xnavara@volny.cz>
10*c2c66affSColin Finck  *
11*c2c66affSColin Finck  * THIS SOFTWARE IS NOT COPYRIGHTED
12*c2c66affSColin Finck  *
13*c2c66affSColin Finck  * This source code is offered for use in the public domain. You may
14*c2c66affSColin Finck  * use, modify or distribute it freely.
15*c2c66affSColin Finck  *
16*c2c66affSColin Finck  * This code is distributed in the hope that it will be useful but
17*c2c66affSColin Finck  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18*c2c66affSColin Finck  * DISCLAIMED. This includes but is not limited to warranties of
19*c2c66affSColin Finck  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20*c2c66affSColin Finck  *
21*c2c66affSColin Finck  */
22*c2c66affSColin Finck 
23*c2c66affSColin Finck #ifndef __PRNTFONT_H
24*c2c66affSColin Finck #define __PRNTFONT_H
25*c2c66affSColin Finck 
26*c2c66affSColin Finck #define UNIFM_VERSION_1_0		0x10000
27*c2c66affSColin Finck #define UNI_GLYPHSETDATA_VERSION_1_0	0x10000
28*c2c66affSColin Finck 
29*c2c66affSColin Finck #define UFM_SOFT	1
30*c2c66affSColin Finck #define UFM_CART        2
31*c2c66affSColin Finck #define UFM_SCALABLE    4
32*c2c66affSColin Finck 
33*c2c66affSColin Finck #define DF_TYPE_HPINTELLIFONT	0
34*c2c66affSColin Finck #define DF_TYPE_TRUETYPE	1
35*c2c66affSColin Finck #define DF_TYPE_PST1		2
36*c2c66affSColin Finck #define DF_TYPE_CAPSL		3
37*c2c66affSColin Finck #define DF_TYPE_OEM1		4
38*c2c66affSColin Finck #define DF_TYPE_OEM2		5
39*c2c66affSColin Finck #define DF_NOITALIC		1
40*c2c66affSColin Finck #define DF_NOUNDER		2
41*c2c66affSColin Finck #define DF_XM_CR		4
42*c2c66affSColin Finck #define DF_NO_BOLD		8
43*c2c66affSColin Finck #define DF_NO_DOUBLE_UNDERLINE	16
44*c2c66affSColin Finck #define DF_NO_STRIKETHRU	32
45*c2c66affSColin Finck #define DF_BKSP_OK		64
46*c2c66affSColin Finck 
47*c2c66affSColin Finck #define MTYPE_COMPOSE			1
48*c2c66affSColin Finck #define MTYPE_DIRECT			2
49*c2c66affSColin Finck #define MTYPE_PAIRED			4
50*c2c66affSColin Finck #define MTYPE_FORMAT_MASK		7
51*c2c66affSColin Finck #define MTYPE_SINGLE			8
52*c2c66affSColin Finck #define MTYPE_DOUBLE			16
53*c2c66affSColin Finck #define MTYPE_DOUBLEBYTECHAR_MASK	24
54*c2c66affSColin Finck #define MTYPE_REPLACE			32
55*c2c66affSColin Finck #define MTYPE_ADD			64
56*c2c66affSColin Finck #define MTYPE_DISABLE			128
57*c2c66affSColin Finck #define MTYPE_PREDEFIN_MASK		192
58*c2c66affSColin Finck 
59*c2c66affSColin Finck #define CC_NOPRECNV	0x0000FFFF
60*c2c66affSColin Finck #define CC_DEFAULT	0
61*c2c66affSColin Finck #define CC_CP437	-1
62*c2c66affSColin Finck #define CC_CP850	-2
63*c2c66affSColin Finck #define CC_CP863	-3
64*c2c66affSColin Finck #define CC_BIG5		-10
65*c2c66affSColin Finck #define CC_ISC		-11
66*c2c66affSColin Finck #define CC_JIS		-12
67*c2c66affSColin Finck #define CC_JIS_ANK	-13
68*c2c66affSColin Finck #define CC_NS86		-14
69*c2c66affSColin Finck #define CC_TCA		-15
70*c2c66affSColin Finck #define CC_GB2312	-16
71*c2c66affSColin Finck #define CC_SJIS		-17
72*c2c66affSColin Finck #define CC_WANSUNG	-18
73*c2c66affSColin Finck 
74*c2c66affSColin Finck #define UFF_FILE_MAGIC		'UFF1'
75*c2c66affSColin Finck #define UFF_VERSION_NUMBER	0x10001
76*c2c66affSColin Finck #define FONT_DIR_SORTED		1
77*c2c66affSColin Finck #define FONT_REC_SIG            'CERF'
78*c2c66affSColin Finck #define WINNT_INSTALLER_SIG     'IFTN'
79*c2c66affSColin Finck 
80*c2c66affSColin Finck #define FONT_FL_UFM             0x0001
81*c2c66affSColin Finck #define FONT_FL_IFI             0x0002
82*c2c66affSColin Finck #define FONT_FL_SOFTFONT        0x0004
83*c2c66affSColin Finck #define FONT_FL_PERMANENT_SF    0x0008
84*c2c66affSColin Finck #define FONT_FL_DEVICEFONT      0x0010
85*c2c66affSColin Finck #define FONT_FL_GLYPHSET_GTT    0x0020
86*c2c66affSColin Finck #define FONT_FL_GLYPHSET_RLE    0x0040
87*c2c66affSColin Finck #define FONT_FL_RESERVED        0x8000
88*c2c66affSColin Finck 
89*c2c66affSColin Finck #define DATA_UFM_SIG        'MFUD'
90*c2c66affSColin Finck #define DATA_IFI_SIG        'IFID'
91*c2c66affSColin Finck #define DATA_GTT_SIG        'TTGD'
92*c2c66affSColin Finck #define DATA_CTT_SIG        'TTCD'
93*c2c66affSColin Finck #define DATA_VAR_SIG        'RAVD'
94*c2c66affSColin Finck 
95*c2c66affSColin Finck #define FG_CANCHANGE	128
96*c2c66affSColin Finck #define WM_FI_FILENAME	900
97*c2c66affSColin Finck 
98*c2c66affSColin Finck #define GET_UNIDRVINFO(pUFM) ((PUNIDRVINFO)((ULONG_PTR)(pUFM) + (pUFM)->loUnidrvInfo))
99*c2c66affSColin Finck #define GET_IFIMETRICS(pUFM) ((IFIMETRICS*)((ULONG_PTR)(pUFM) + (pUFM)->loIFIMetrics))
100*c2c66affSColin Finck #define GET_EXTTEXTMETRIC(pUFM) ((EXTTEXTMETRIC*)((ULONG_PTR)(pUFM) + (pUFM)->loExtTextMetric))
101*c2c66affSColin Finck #define GET_WIDTHTABLE(pUFM) ((PWIDTHTABLE)((ULONG_PTR)(pUFM) + (pUFM)->loWidthTable))
102*c2c66affSColin Finck #define GET_KERNDATA(pUFM) ((PKERNDATA)((ULONG_PTR)(pUFM) + (pUFM)->loKernPair))
103*c2c66affSColin Finck #define GET_SELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->SelectFont.loOffset)
104*c2c66affSColin Finck #define GET_UNSELECT_CMD(pUni) ((PCHAR)(pUni) + (pUni)->UnSelectFont.loOffset)
105*c2c66affSColin Finck #define GET_GLYPHRUN(pGTT) ((PGLYPHRUN)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loRunOffset))
106*c2c66affSColin Finck #define GET_CODEPAGEINFO(pGTT) ((PUNI_CODEPAGEINFO)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loCodePageOffset))
107*c2c66affSColin Finck #define GET_MAPTABLE(pGTT) ((PMAPTABLE)((ULONG_PTR)(pGTT) + ((PUNI_GLYPHSETDATA)pGTT)->loMapTableOffset))
108*c2c66affSColin Finck 
109*c2c66affSColin Finck typedef struct _UNIFM_HDR
110*c2c66affSColin Finck {
111*c2c66affSColin Finck   DWORD  dwSize;
112*c2c66affSColin Finck   DWORD  dwVersion;
113*c2c66affSColin Finck   ULONG  ulDefaultCodepage;
114*c2c66affSColin Finck   LONG  lGlyphSetDataRCID;
115*c2c66affSColin Finck   DWORD  loUnidrvInfo;
116*c2c66affSColin Finck   DWORD  loIFIMetrics;
117*c2c66affSColin Finck   DWORD  loExtTextMetric;
118*c2c66affSColin Finck   DWORD  loWidthTable;
119*c2c66affSColin Finck   DWORD  loKernPair;
120*c2c66affSColin Finck   DWORD  dwReserved[2];
121*c2c66affSColin Finck } UNIFM_HDR, *PUNIFM_HDR;
122*c2c66affSColin Finck 
123*c2c66affSColin Finck typedef struct _INVOC
124*c2c66affSColin Finck {
125*c2c66affSColin Finck   DWORD  dwCount;
126*c2c66affSColin Finck   DWORD  loOffset;
127*c2c66affSColin Finck } INVOC, *PINVOC;
128*c2c66affSColin Finck 
129*c2c66affSColin Finck typedef struct _UNIDRVINFO
130*c2c66affSColin Finck {
131*c2c66affSColin Finck   DWORD  dwSize;
132*c2c66affSColin Finck   DWORD  flGenFlags;
133*c2c66affSColin Finck   WORD  wType;
134*c2c66affSColin Finck   WORD  fCaps;
135*c2c66affSColin Finck   WORD  wXRes;
136*c2c66affSColin Finck   WORD  wYRes;
137*c2c66affSColin Finck   SHORT  sYAdjust;
138*c2c66affSColin Finck   SHORT  sYMoved;
139*c2c66affSColin Finck   WORD  wPrivateData;
140*c2c66affSColin Finck   SHORT  sShift;
141*c2c66affSColin Finck   INVOC  SelectFont;
142*c2c66affSColin Finck   INVOC  UnSelectFont;
143*c2c66affSColin Finck   WORD  wReserved[4];
144*c2c66affSColin Finck } UNIDRVINFO, *PUNIDRVINFO;
145*c2c66affSColin Finck 
146*c2c66affSColin Finck typedef struct _EXTTEXTMETRIC
147*c2c66affSColin Finck {
148*c2c66affSColin Finck   SHORT  emSize;
149*c2c66affSColin Finck   SHORT  emPointSize;
150*c2c66affSColin Finck   SHORT  emOrientation;
151*c2c66affSColin Finck   SHORT  emMasterHeight;
152*c2c66affSColin Finck   SHORT  emMinScale;
153*c2c66affSColin Finck   SHORT  emMaxScale;
154*c2c66affSColin Finck   SHORT  emMasterUnits;
155*c2c66affSColin Finck   SHORT  emCapHeight;
156*c2c66affSColin Finck   SHORT  emXHeight;
157*c2c66affSColin Finck   SHORT  emLowerCaseAscent;
158*c2c66affSColin Finck   SHORT  emLowerCaseDescent;
159*c2c66affSColin Finck   SHORT  emSlant;
160*c2c66affSColin Finck   SHORT  emSuperScript;
161*c2c66affSColin Finck   SHORT  emSubScript;
162*c2c66affSColin Finck   SHORT  emSuperScriptSize;
163*c2c66affSColin Finck   SHORT  emSubScriptSize;
164*c2c66affSColin Finck   SHORT  emUnderlineOffset;
165*c2c66affSColin Finck   SHORT  emUnderlineWidth;
166*c2c66affSColin Finck   SHORT  emDoubleUpperUnderlineOffset;
167*c2c66affSColin Finck   SHORT  emDoubleLowerUnderlineOffset;
168*c2c66affSColin Finck   SHORT  emDoubleUpperUnderlineWidth;
169*c2c66affSColin Finck   SHORT  emDoubleLowerUnderlineWidth;
170*c2c66affSColin Finck   SHORT  emStrikeOutOffset;
171*c2c66affSColin Finck   SHORT  emStrikeOutWidth;
172*c2c66affSColin Finck   WORD  emKernPairs;
173*c2c66affSColin Finck   WORD  emKernTracks;
174*c2c66affSColin Finck } EXTTEXTMETRIC, *PEXTTEXTMETRIC;
175*c2c66affSColin Finck 
176*c2c66affSColin Finck typedef struct _WIDTHRUN
177*c2c66affSColin Finck {
178*c2c66affSColin Finck   WORD  wStartGlyph;
179*c2c66affSColin Finck   WORD  wGlyphCount;
180*c2c66affSColin Finck   DWORD  loCharWidthOffset;
181*c2c66affSColin Finck } WIDTHRUN, *PWIDTHRUN;
182*c2c66affSColin Finck 
183*c2c66affSColin Finck typedef struct _WIDTHTABLE
184*c2c66affSColin Finck {
185*c2c66affSColin Finck   DWORD  dwSize;
186*c2c66affSColin Finck   DWORD  dwRunNum;
187*c2c66affSColin Finck   WIDTHRUN  WidthRun[1];
188*c2c66affSColin Finck } WIDTHTABLE, *PWIDTHTABLE;
189*c2c66affSColin Finck 
190*c2c66affSColin Finck typedef struct _KERNDATA
191*c2c66affSColin Finck {
192*c2c66affSColin Finck   DWORD  dwSize;
193*c2c66affSColin Finck   DWORD  dwKernPairNum;
194*c2c66affSColin Finck   FD_KERNINGPAIR  KernPair[1];
195*c2c66affSColin Finck } KERNDATA, *PKERNDATA;
196*c2c66affSColin Finck 
197*c2c66affSColin Finck typedef struct _UNI_GLYPHSETDATA
198*c2c66affSColin Finck {
199*c2c66affSColin Finck   DWORD  dwSize;
200*c2c66affSColin Finck   DWORD  dwVersion;
201*c2c66affSColin Finck   DWORD  dwFlags;
202*c2c66affSColin Finck   LONG  lPredefinedID;
203*c2c66affSColin Finck   DWORD  dwGlyphCount;
204*c2c66affSColin Finck   DWORD  dwRunCount;
205*c2c66affSColin Finck   DWORD  loRunOffset;
206*c2c66affSColin Finck   DWORD  dwCodePageCount;
207*c2c66affSColin Finck   DWORD  loCodePageOffset;
208*c2c66affSColin Finck   DWORD  loMapTableOffset;
209*c2c66affSColin Finck   DWORD  dwReserved[2];
210*c2c66affSColin Finck } UNI_GLYPHSETDATA, *PUNI_GLYPHSETDATA;
211*c2c66affSColin Finck 
212*c2c66affSColin Finck typedef struct _UNI_CODEPAGEINFO
213*c2c66affSColin Finck {
214*c2c66affSColin Finck   DWORD  dwCodePage;
215*c2c66affSColin Finck   INVOC  SelectSymbolSet;
216*c2c66affSColin Finck   INVOC  UnSelectSymbolSet;
217*c2c66affSColin Finck } UNI_CODEPAGEINFO, *PUNI_CODEPAGEINFO;
218*c2c66affSColin Finck 
219*c2c66affSColin Finck typedef struct _GLYPHRUN
220*c2c66affSColin Finck {
221*c2c66affSColin Finck   WCHAR  wcLow;
222*c2c66affSColin Finck   WORD  wGlyphCount;
223*c2c66affSColin Finck } GLYPHRUN, *PGLYPHRUN;
224*c2c66affSColin Finck 
225*c2c66affSColin Finck typedef struct _TRANSDATA
226*c2c66affSColin Finck {
227*c2c66affSColin Finck   BYTE  ubCodePageID;
228*c2c66affSColin Finck   BYTE  ubType;
229*c2c66affSColin Finck   union
230*c2c66affSColin Finck   {
231*c2c66affSColin Finck     SHORT  sCode;
232*c2c66affSColin Finck     BYTE  ubCode;
233*c2c66affSColin Finck     BYTE  ubPairs[2];
234*c2c66affSColin Finck   } uCode;
235*c2c66affSColin Finck } TRANSDATA, *PTRANSDATA;
236*c2c66affSColin Finck 
237*c2c66affSColin Finck typedef struct _MAPTABLE {
238*c2c66affSColin Finck   DWORD  dwSize;
239*c2c66affSColin Finck   DWORD  dwGlyphNum;
240*c2c66affSColin Finck   TRANSDATA  Trans[1];
241*c2c66affSColin Finck } MAPTABLE, *PMAPTABLE;
242*c2c66affSColin Finck 
243*c2c66affSColin Finck typedef struct _UFF_FILEHEADER {
244*c2c66affSColin Finck   DWORD  dwSignature;
245*c2c66affSColin Finck   DWORD  dwVersion;
246*c2c66affSColin Finck   DWORD  dwSize;
247*c2c66affSColin Finck   DWORD  nFonts;
248*c2c66affSColin Finck   DWORD  nGlyphSets;
249*c2c66affSColin Finck   DWORD  nVarData;
250*c2c66affSColin Finck   DWORD  offFontDir;
251*c2c66affSColin Finck   DWORD  dwFlags;
252*c2c66affSColin Finck   DWORD  dwReserved[4];
253*c2c66affSColin Finck } UFF_FILEHEADER, *PUFF_FILEHEADER;
254*c2c66affSColin Finck 
255*c2c66affSColin Finck typedef struct _UFF_FONTDIRECTORY {
256*c2c66affSColin Finck   DWORD  dwSignature;
257*c2c66affSColin Finck   WORD  wSize;
258*c2c66affSColin Finck   WORD  wFontID;
259*c2c66affSColin Finck   SHORT  sGlyphID;
260*c2c66affSColin Finck   WORD  wFlags;
261*c2c66affSColin Finck   DWORD  dwInstallerSig;
262*c2c66affSColin Finck   DWORD  offFontName;
263*c2c66affSColin Finck   DWORD  offCartridgeName;
264*c2c66affSColin Finck   DWORD  offFontData;
265*c2c66affSColin Finck   DWORD  offGlyphData;
266*c2c66affSColin Finck   DWORD  offVarData;
267*c2c66affSColin Finck } UFF_FONTDIRECTORY, *PUFF_FONTDIRECTORY;
268*c2c66affSColin Finck 
269*c2c66affSColin Finck typedef struct _DATA_HEADER {
270*c2c66affSColin Finck   DWORD  dwSignature;
271*c2c66affSColin Finck   WORD  wSize;
272*c2c66affSColin Finck   WORD  wDataID;
273*c2c66affSColin Finck   DWORD  dwDataSize;
274*c2c66affSColin Finck   DWORD  dwReserved;
275*c2c66affSColin Finck } DATA_HEADER, *PDATA_HEADER;
276*c2c66affSColin Finck 
277*c2c66affSColin Finck typedef struct _OEMFONTINSTPARAM {
278*c2c66affSColin Finck   DWORD  cbSize;
279*c2c66affSColin Finck   HANDLE  hPrinter;
280*c2c66affSColin Finck   HANDLE  hModule;
281*c2c66affSColin Finck   HANDLE  hHeap;
282*c2c66affSColin Finck   DWORD  dwFlags;
283*c2c66affSColin Finck   PWSTR  pFontInstallerName;
284*c2c66affSColin Finck } OEMFONTINSTPARAM, *POEMFONTINSTPARAM;
285*c2c66affSColin Finck 
286*c2c66affSColin Finck #endif /* __PRNTFONT_H */
287