xref: /reactos/sdk/include/psdk/t2embapi.h (revision c2c66aff)
1 #ifndef __T2EMBED_API_H
2 #define __T2EMBED_API_H
3 
4 #ifndef CHARSET_UNICODE
5 #define CHARSET_UNICODE    1
6 #define CHARSET_DEFAULT    1
7 #define CHARSET_SYMBOL     2
8 #define CHARSET_GLYPHIDX   3
9 #endif
10 
11 #ifndef EMBED_PREVIEWPRINT
12 #define EMBED_PREVIEWPRINT 1
13 #define EMBED_EDITABLE     2
14 #define EMBED_INSTALLABLE  3
15 #define EMBED_NOEMBEDDING  4
16 #endif
17 
18 #ifndef LICENSE_INSTALLABLE
19 #define LICENSE_INSTALLABLE   0x0
20 #define LICENSE_DEFAULT       0x0
21 #define LICENSE_NOEMBEDDING   0x2
22 #define LICENSE_PREVIEWPRINT  0x4
23 #define LICENSE_EDITABLE      0x8
24 #endif
25 
26 #ifndef TTEMBED_RAW
27 #define TTEMBED_RAW                       0x0
28 #define TTEMBED_SUBSET                    0x1
29 #define TTEMBED_TTCOMPRESSED              0x4
30 #define TTEMBED_FAILIFVARIATIONSIMULATED  0x10
31 #define TTEMBED_EMBEDEUDC                 0x20
32 #define TTEMBED_VALIDATIONTESTS           0x40
33 #define TTEMBED_WEBOBJECT                 0x80
34 #define TTEMBED_ENCRYPTDATA               0x10000000
35 #endif
36 
37 #ifndef E_NONE
38 #define E_NONE 0x0
39 #endif
40 
41 #define E_API_NOTIMPL 0x0001L
42 
43 #ifndef E_CHARCODECOUNTINVALID
44 #define E_CHARCODECOUNTINVALID     0x2
45 #define E_CHARCODESETINVALID       0x3
46 #define E_DEVICETRUETYPEFONT       0x4
47 #define E_HDCINVALID               0x6
48 #define E_NOFREEMEMORY             0x7
49 #define E_FONTREFERENCEINVALID     0x8
50 #define E_NOTATRUETYPEFONT         0xA
51 #define E_ERRORACCESSINGFONTDATA   0xC
52 #define E_ERRORACCESSINGFACENAME   0xD
53 #define E_ERRORUNICODECONVERSION   0x11
54 #define E_ERRORCONVERTINGCHARS     0x12
55 #define E_EXCEPTION                0x13
56 #define E_RESERVEDPARAMNOTNULL     0x14
57 #define E_CHARSETINVALID           0x15
58 #define E_WIN32S_NOTSUPPORTED      0x16
59 #define E_FILE_NOT_FOUND           0x17
60 #define E_TTC_INDEX_OUT_OF_RANGE   0x18
61 #define E_INPUTPARAMINVALID        0x19
62 #endif
63 
64 #ifndef E_ERRORCOMPRESSINGFONTDATA
65 #define E_ERRORCOMPRESSINGFONTDATA    0x100
66 #define E_FONTDATAINVALID             0x102
67 #define E_NAMECHANGEFAILED            0x103
68 #define E_FONTNOTEMBEDDABLE           0x104
69 #define E_PRIVSINVALID                0x105
70 #define E_SUBSETTINGFAILED            0x106
71 #define E_READFROMSTREAMFAILED        0x107
72 #define E_SAVETOSTREAMFAILED          0x108
73 #define E_NOOS2                       0x109
74 #define E_T2NOFREEMEMORY              0x10A
75 #define E_ERRORREADINGFONTDATA        0x10B
76 #define E_FLAGSINVALID                0x10C
77 #define E_ERRORCREATINGFONTFILE       0x10D
78 #define E_FONTALREADYEXISTS           0x10E
79 #define E_FONTNAMEALREADYEXISTS       0x10F
80 #define E_FONTINSTALLFAILED           0x110
81 #define E_ERRORDECOMPRESSINGFONTDATA  0x111
82 #define E_ERRORACCESSINGEXCLUDELIST   0x112
83 #define E_FACENAMEINVALID             0x113
84 #define E_STREAMINVALID               0x114
85 #define E_STATUSINVALID               0x115
86 #define E_PRIVSTATUSINVALID           0x116
87 #define E_PERMISSIONSINVALID          0x117
88 #define E_PBENABLEDINVALID            0x118
89 #define E_SUBSETTINGEXCEPTION         0x119
90 #define E_SUBSTRING_TEST_FAIL         0x11A
91 #define E_FONTVARIATIONSIMULATED      0x11B
92 #define E_FONTVALIDATEFAIL            0x11C
93 #define E_FONTFAMILYNAMENOTINFULL     0x11D
94 #endif
95 
96 #ifndef E_ADDFONTFAILED
97 #define E_ADDFONTFAILED             0x200
98 #define E_COULDNTCREATETEMPFILE     0x201
99 #define E_FONTFILECREATEFAILED      0x203
100 #define E_WINDOWSAPI                0x204
101 #define E_FONTFILENOTFOUND          0x205
102 #define E_RESOURCEFILECREATEFAILED  0x206
103 #define E_ERROREXPANDINGFONTDATA    0x207
104 #define E_ERRORGETTINGDC            0x208
105 #define E_EXCEPTIONINDECOMPRESSION  0x209
106 #define E_EXCEPTIONINCOMPRESSION    0x20A
107 #endif
108 
109 #ifdef __cplusplus
110 extern "C" {
111 #endif
112 
113 typedef unsigned long(WINAPIV *WRITEEMBEDPROC)
114 (
115     void* lpvWriteStream,
116     const void* lpvBuffer,
117     const unsigned long cbBuffer
118 );
119 
120 typedef unsigned long(WINAPIV *READEMBEDPROC)
121 (
122     void* lpvReadStream,
123     void* lpvBuffer,
124     const unsigned long cbBuffer
125 );
126 
127 
128 typedef struct
129 {
130     unsigned long ulStructSize;
131     long lTestFromSize;
132     long lTestToSize;
133     unsigned long ulCharSet;
134     unsigned short usReserved1;
135     unsigned short usCharCodeCount;
136     unsigned short* pusCharCodeSet;
137 } TTVALIDATIONTESTPARAMS;
138 
139 typedef struct
140 {
141     unsigned long ulStructSize;
142     long lTestFromSize;
143     long lTestToSize;
144     unsigned long ulCharSet;
145     unsigned short usReserved1;
146     unsigned short usCharCodeCount;
147     unsigned long* pulCharCodeSet;
148 } TTVALIDATIONTESTPARAMSEX;
149 
150 typedef struct
151 {
152     unsigned short usStructSize;
153     unsigned short usRootStrSize;
154     unsigned short *pusRootStr;
155 } TTEMBEDINFO;
156 
157 typedef struct
158 {
159     unsigned short usStructSize;
160     unsigned short usRefStrSize;
161     unsigned short *pusRefStr;
162 } TTLOADINFO;
163 
164 LONG
165 WINAPI
166 TTCharToUnicode(HDC hDC,
167                 UCHAR* pucCharCodes,
168                 ULONG ulCharCodeSize,
169                 USHORT* pusShortCodes,
170                 ULONG ulShortCodeSize,
171                 ULONG ulFlags);
172 
173 LONG
174 WINAPI
175 TTDeleteEmbeddedFont(HANDLE hFontReference,
176                      ULONG ulFlags,
177                      ULONG* pulStatus);
178 
179 LONG
180 WINAPI
181 TTEmbedFont(HDC hDC,
182             ULONG ulFlags,
183             ULONG ulCharSet,
184             ULONG* pulPrivStatus,
185             ULONG* pulStatus,
186             WRITEEMBEDPROC lpfnWriteToStream,
187             LPVOID lpvWriteStream,
188             USHORT* pusCharCodeSet,
189             USHORT usCharCodeCount,
190             USHORT usLanguage,
191             TTEMBEDINFO* pTTEmbedInfo);
192 
193 LONG
194 WINAPI
195 TTEmbedFontFromFileA(HDC hDC,
196                      LPCSTR szFontFileName,
197                      USHORT usTTCIndex,
198                      ULONG ulFlags,
199                      ULONG ulCharSet,
200                      ULONG* pulPrivStatus,
201                      ULONG* pulStatus,
202                      WRITEEMBEDPROC lpfnWriteToStream,
203                      LPVOID lpvWriteStream,
204                      USHORT* pusCharCodeSet,
205                      USHORT usCharCodeCount,
206                      USHORT usLanguage,
207                      TTEMBEDINFO* pTTEmbedInfo);
208 
209 LONG
210 WINAPI
211 TTEnableEmbeddingForFacename(LPSTR lpszFacename,
212                              BOOL bEnable);
213 
214 LONG
215 WINAPI
216 TTGetEmbeddedFontInfo(ULONG ulFlags,
217                       ULONG* pulPrivStatus,
218                       ULONG ulPrivs,
219                       ULONG* pulStatus,
220                       READEMBEDPROC lpfnReadFromStream,
221                       LPVOID lpvReadStream,
222                       TTLOADINFO* pTTLoadInfo);
223 
224 LONG
225 WINAPI
226 TTGetEmbeddingType(HDC hDC,
227                    ULONG* pulPrivStatus);
228 
229 LONG
230 WINAPI
231 TTIsEmbeddingEnabled(HDC hDC,
232                      BOOL* pbEnabled);
233 
234 LONG
235 WINAPI
236 TTIsEmbeddingEnabledForFacename(LPCSTR lpszFacename,
237                                 BOOL* pbEnabled);
238 
239 LONG
240 WINAPI
241 TTLoadEmbeddedFont(HANDLE *phFontReference,
242                    ULONG ulFlags,
243                    ULONG* pulPrivStatus,
244                    ULONG ulPrivs,
245                    ULONG* pulStatus,
246                    READEMBEDPROC lpfnReadFromStream,
247                    LPVOID lpvReadStream,
248                    LPWSTR szWinFamilyName,
249                    LPSTR szMacFamilyName,
250                    TTLOADINFO* pTTLoadInfo);
251 
252 LONG
253 WINAPI
254 TTRunValidationTests(HDC hDC,
255                      TTVALIDATIONTESTPARAMS* pTestParam);
256 
257 LONG
258 WINAPI
259 TTEmbedFontEx(HDC hDC,
260               ULONG ulFlags,
261               ULONG ulCharSet,
262               ULONG* pulPrivStatus,
263               ULONG* pulStatus,
264               WRITEEMBEDPROC lpfnWriteToStream,
265               LPVOID lpvWriteStream,
266               ULONG* pulCharCodeSet,
267               USHORT usCharCodeCount,
268               USHORT usLanguage,
269               TTEMBEDINFO* pTTEmbedInfo);
270 
271 LONG
272 WINAPI
273 TTRunValidationTestsEx(HDC hDC,
274                        TTVALIDATIONTESTPARAMSEX* pTestParam);
275 
276 LONG
277 WINAPI
278 TTGetNewFontName(HANDLE* phFontReference,
279                  LPWSTR szWinFamilyName,
280                  long cchMaxWinName,
281                  LPSTR szMacFamilyName,
282                  long cchMaxMacName);
283 
284 #ifdef __cplusplus
285     }
286 #endif
287 
288 #endif /* __T2EMBED_API_H */
289