source: trunk/include/ft2lib.h@ 21304

Last change on this file since 21304 was 21304, checked in by ydario, 16 years ago

Gdi32 updates.

  • Property svn:eol-style set to native
File size: 13.7 KB
Line 
1/* $Id: ft2lib.h,v 1.1 2004/01/19 11:29:21 sandervl Exp $ */
2/** @file
3 *
4 * InnoTek Font Engine for OS/2 - public header
5 *
6 * Note: You must include os2.h with INCL_PM defined before this header.
7 *
8 * (C) 2003 InnoTek Systemberatung GmbH
9 *
10 */
11
12#ifndef __H_FT2LIB
13#define __H_FT2LIB
14
15// Should be higher than any Odin (custom build) dll!
16#define EXITLIST_FT2LIB 0x00009F00
17
18#define FT2_ERROR 0xffffffff
19
20/* for GetGlyphIndices() */
21#define FT2_GGI_MARK_NONEXISTING_GLYPHS 0x0001
22
23
24/*******************************************************************************
25* Structures and Typedefs *
26*******************************************************************************/
27
28/** FT2LIB statistics .
29 * Used with Ft2QueryStatistics. */
30typedef struct FT2LIBSTATS
31{
32 /** Size of this structure. (input) */
33 unsigned cb;
34 /** @name The Cache. (output)
35 * @{ */
36 unsigned cbMaxWeight;
37 unsigned cbCurWeight;
38 unsigned cNodes;
39 unsigned cFacesMax;
40 unsigned cFacesCur;
41 unsigned cSizesMax;
42 unsigned cSizesCur;
43 /** @} */
44
45 /** @name The Shared Heap. (output)
46 * @{ */
47 unsigned cbMaxSize;
48 unsigned cbCommitted;
49 unsigned cbUsed;
50 unsigned cbMaxFree;
51 unsigned cFrees;
52 unsigned cAllocs;
53 unsigned cUsers;
54 /** @} */
55
56 /** @name The Uconv objects. (output)
57 * @{ */
58 unsigned cObjects;
59 unsigned cTotalCreateCalls;
60 /** @} */
61} FT2LIBSTATS, *PFT2LIBSTATS;
62
63typedef BOOL (* PFN_WRITELOG)(char *fmt, ...);
64
65#if defined(__WIN32TYPE_H__) || defined(_OS2WIN_H) || defined(__INCLUDE_WINUSER_H) || defined(__WINE_WINBASE_H)
66#ifndef OS2_INCLUDED
67typedef void *PBUNDLE;
68#ifndef __DCDATA_H__
69typedef void *PSIZEF;
70#endif
71typedef void *PPOINTL;
72typedef void *PGRADIENTL;
73typedef void *PKERNINGPAIRS;
74typedef char *PSTR8;
75typedef char *PSZ;
76typedef void *PFATTRS;
77typedef void *PFONTMETRICS;
78typedef unsigned long HAB;
79typedef unsigned long HPAL;
80
81#endif
82#else
83/* for GetGlyphOutLine function */
84typedef struct
85{
86 unsigned short fract;
87 signed short value;
88} FIXED_W;
89
90
91typedef struct
92{
93 FIXED_W eM11;
94 FIXED_W eM12;
95 FIXED_W eM21;
96 FIXED_W eM22;
97} MAT2, *LPMAT2;
98
99typedef struct
100{
101 UINT gmBlackBoxX;
102 UINT gmBlackBoxY;
103 POINTL gmptGlyphOrigin;
104 SHORT gmCellIncX;
105 SHORT gmCellIncY;
106} GLYPHMETRICS, *LPGLYPHMETRICS;
107
108#define GGO_METRICS 0
109#define GGO_BITMAP 1
110#define GGO_NATIVE 2
111#define GGO_BEZIER 3
112#define GGO_GRAY2_BITMAP 4
113#define GGO_GRAY4_BITMAP 5
114#define GGO_GRAY8_BITMAP 6
115#define GGO_GLYPH_INDEX 0x80
116
117typedef struct tagPOINTFX
118{
119 FIXED_W x;
120 FIXED_W y;
121} POINTFX, *LPPOINTFX;
122
123typedef struct tagTTPOLYCURVE
124{
125 USHORT wType;
126 USHORT cpfx;
127 POINTFX apfx[1];
128} TTPOLYCURVE, *LPTTPOLYCURVE;
129
130typedef struct tagTTPOLYGONHEADER
131{
132 ULONG cb;
133 ULONG dwType;
134 POINTFX pfxStart;
135} TTPOLYGONHEADER, *LPTTPOLYGONHEADER;
136
137#define TT_PRIM_LINE 1
138#define TT_PRIM_QSPLINE 2
139#define TT_POLYGON_TYPE 24
140
141 /* ExtTextOut() parameters */
142#define ETO_GRAYED 0x0001
143#define ETO_OPAQUE 0x0002
144#define ETO_CLIPPED 0x0004
145#define ETO_GLYPH_INDEX 0x0010
146#define ETO_RTLREADING 0x0080
147#define ETO_IGNORELANGUAGE 0x1000
148
149
150// Unicode functions
151#define WIN32API __stdcall
152
153typedef unsigned long DWORD;
154typedef const char * LPCSTR;
155typedef char * LPSTR;
156typedef const USHORT *LPCWSTR;
157typedef USHORT *LPWSTR;
158typedef USHORT WCHAR;
159
160#define CP_ACP 0
161#define CP_OEMCP 1
162#define CP_MACCP 2
163#define CP_THREAD_ACP 3
164#define CP_SYMBOL 42
165#define CP_UTF7 65000
166#define CP_UTF8 65001
167
168#define MB_PRECOMPOSED 0x00000001
169#define MB_COMPOSITE 0x00000002
170#define MB_USEGLYPHCHARS 0x00000004
171#define MB_ERR_INVALID_CHARS 0x00000008
172
173/* for GetCharacterPlacement () */
174
175#define GCP_DBCS 0x0001
176#define GCP_REORDER 0x0002
177#define GCP_USEKERNING 0x0008
178#define GCP_GLYPHSHAPE 0x0010
179#define GCP_LIGATE 0x0020
180#define GCP_DIACRITIC 0x0100
181#define GCP_KASHIDA 0x0200
182#define GCP_ERROR 0x8000
183#define FLI_MASK 0x103b
184#define GCP_JUSTIFY 0x00010000L
185#define FLI_GLYPHS 0x00040000L
186#define GCP_CLASSIN 0x00080000L
187#define GCP_MAXEXTENT 0x00100000L
188#define GCP_JUSTIFYIN 0x00200000L
189#define GCP_DISPLAYZWG 0x00400000L
190#define GCP_SYMSWAPOFF 0x00800000L
191#define GCP_NUMERICOVERRIDE 0x01000000L
192#define GCP_NEUTRALOVERRIDE 0x02000000L
193#define GCP_NUMERICSLATIN 0x04000000L
194#define GCP_NUMERICSLOCAL 0x08000000L
195
196#define GCPCLASS_LATIN 1
197#define GCPCLASS_HEBREW 2
198#define GCPCLASS_ARABIC 3
199#define GCPCLASS_NEUTRAL 4
200#define GCPCLASS_LOCALNUMBER 5
201#define GCPCLASS_LATINNUMBER 6
202#define GCPCLASS_LATINNUMERICTERMINATOR 7
203#define GCPCLASS_LATINNUMERICSEPARATOR 8
204#define GCPCLASS_NUMERICSEPARATOR 9
205#define GCPCLASS_PREBOUNDLTR 0x80
206#define GCPCLASS_PREBOUNDRLT 0x40
207#define GCPCLASS_POSTBOUNDLTR 0x20
208#define GCPCLASS_POSTBOUNDRTL 0x10
209
210#define GCPGLYPH_LINKBEFORE 0x8000
211#define GCPGLYPH_LINKAFTER 0x4000
212
213typedef struct tagGCP_RESULTSW
214{
215 DWORD lStructSize;
216 LPWSTR lpOutString;
217 UINT *lpOrder;
218 INT *lpDx;
219 INT *lpCaretPos;
220 LPSTR lpClass;
221 LPWSTR lpGlyphs;
222 UINT nGlyphs;
223 UINT nMaxFit;
224} GCP_RESULTSW, *LPGCP_RESULTSW;
225
226#endif
227
228// Ft2QueryFontType
229#define FT2_FONTTYPE_UNKNOWN 0
230#define FT2_FONTTYPE_TRUETYPE 1
231#define FT2_FONTTYPE_TYPE1 2
232#define FT2_FONTTYPE_BITMAP 3
233
234typedef INT (* WIN32API PFN_MULTIBYTETOWIDECHAR)(UINT page, DWORD flags, LPCSTR src, INT srclen,
235 LPWSTR dst, INT dstlen);
236typedef INT (* WIN32API PFN_WIDECHARTOMULTIBYTE)(UINT page, DWORD flags, LPCWSTR src, INT srclen,
237 LPSTR dst, INT dstlen, LPCSTR defchar, BOOL *used);
238
239
240/*******************************************************************************
241* APIs *
242*******************************************************************************/
243
244/** @name FT2LIB Query APIs
245 * @{ */
246/** Get the FT2LIB version. */
247VOID APIENTRY Ft2GetVersion(LONG *plMajor, LONG *plMinor, LONG *plBuildNumber);
248/** Query statistics for FT2LIB. */
249BOOL APIENTRY Ft2QueryStatistics(PFT2LIBSTATS pStats);
250// Write statistics to stdout
251BOOL APIENTRY Ft2DumpStatistics(PFN_WRITELOG pfnWriteLog);
252/** @} */
253
254
255/** @name Common GPI Control APIs
256 * @{ */
257HPS APIENTRY Ft2CreatePS(HAB hab, HDC hdc, PSIZEL psizlSize, ULONG flOptions);
258BOOL APIENTRY Ft2DestroyPS(HPS hps);
259BOOL APIENTRY Ft2Associate(HPS hps, HDC hdc);
260BOOL APIENTRY Ft2RestorePS(HPS hps, LONG lPSid);
261LONG APIENTRY Ft2SavePS(HPS hps);
262BOOL APIENTRY Ft2Erase(HPS hps);
263/** @} */
264
265
266/** @name Global Primitive APIs
267 * @{ */
268BOOL APIENTRY Ft2SetColor(HPS hps, LONG lColor);
269LONG APIENTRY Ft2QueryColor(HPS hps);
270BOOL APIENTRY Ft2SetAttrs(HPS hps, LONG lPrimType, ULONG flAttrMask,
271 ULONG flDefMask, PBUNDLE ppbunAttrs);
272/** @} */
273
274
275/** @name Line Primitive APIs
276 * @{ */
277LONG APIENTRY Ft2Box(HPS hps, LONG lControl, PPOINTL pptlPoint,
278 LONG lHRound, LONG lVRound);
279BOOL APIENTRY Ft2Move(HPS hps, PPOINTL pptlPoint);
280/** @} */
281
282
283/** @name Global Primitive APIs
284 * @{ */
285BOOL APIENTRY Ft2SetBackColor(HPS hps, LONG lColor);
286LONG APIENTRY Ft2QueryBackColor(HPS hps);
287BOOL APIENTRY Ft2SetMix(HPS hps, LONG lMixMode);
288BOOL APIENTRY Ft2SetBackMix(HPS hps, LONG lMixMode);
289/** @} */
290
291
292/** @name Character Primitive APIs
293 * @{ */
294BOOL APIENTRY Ft2QueryCharStringPosA(HPS hps, ULONG flOptions, LONG lCount,
295 PCH pchString, PLONG alXincrements, PPOINTL aptlPositions);
296BOOL APIENTRY Ft2QueryCharStringPosW(HPS hps, ULONG flOptions, LONG lCount,
297 LPWSTR pchString, PLONG alXincrements, PPOINTL aptlPositions);
298BOOL APIENTRY Ft2QueryTextBoxA(HPS hps, LONG lCount1, PCH pchString,LONG lCount2, PPOINTL aptlPoints);
299BOOL APIENTRY Ft2QueryTextBoxW(HPS hps, LONG lCount1, LPWSTR pchString,LONG lCount2, PPOINTL aptlPoints);
300BOOL APIENTRY Ft2SetCharSet(HPS hps, LONG llcid);
301LONG APIENTRY Ft2QueryCharSet(HPS hps);
302BOOL APIENTRY Ft2SetCharBox(HPS hps, PSIZEF psizfxBox);
303BOOL APIENTRY Ft2QueryCharBox(HPS hps, PSIZEF psizfxSize);
304BOOL APIENTRY Ft2SetCharAngle(HPS hps, PGRADIENTL pgradlAngle);
305BOOL APIENTRY Ft2QueryCharAngle(HPS hps, PGRADIENTL pgradlAngle);
306BOOL APIENTRY Ft2SetTextAlignment(HPS hps, LONG lHoriz, LONG lVert);
307BOOL APIENTRY Ft2QueryTextAlignment(HPS hps, PLONG plHoriz, PLONG plVert);
308BOOL APIENTRY Ft2SetCharBreakExtra(HPS hps, FIXED BreakExtra);
309BOOL APIENTRY Ft2SetCharDirection(HPS hps, LONG lDirection);
310
311/** @} */
312
313
314/** @name Physical and Logical Font APIs
315 * @{ */
316LONG APIENTRY Ft2CreateLogFont(HPS hps, PSTR8 pName, LONG lLcid, PFATTRS pfatAttrs);
317BOOL APIENTRY Ft2DeleteSetId(HPS hps, LONG lLcid);
318BOOL APIENTRY Ft2QueryLogicalFont(HPS PS, LONG lcid, PSTR8 name,
319 PFATTRS attrs, LONG length);
320/** @} */
321
322
323/** @name Palette Manager APIs
324 * @{ */
325HPAL APIENTRY Ft2CreatePalette(HAB hab, ULONG flOptions, ULONG ulFormat,
326 ULONG ulCount, PULONG aulTable);
327BOOL APIENTRY Ft2DeletePalette(HPAL hpal);
328LONG APIENTRY Ft2QueryFonts(HPS hps, ULONG flOptions, PSZ pszFacename,
329 PLONG plReqFonts, LONG lMetricsLength, PFONTMETRICS afmMetrics);
330BOOL APIENTRY Ft2SetCurrentPosition(HPS hps, PPOINTL pptlPoint);
331BOOL APIENTRY Ft2QueryCurrentPosition(HPS hps, PPOINTL pptlPoint);
332LONG APIENTRY Ft2SetPel(HPS hps, PPOINTL pptlPoint);
333LONG APIENTRY Ft2QueryPel(HPS hps, PPOINTL pptlPoint);
334BOOL APIENTRY Ft2QueryFontMetrics(HPS hps, LONG lMetricsLength, PFONTMETRICS pfmMetrics);
335LONG APIENTRY Ft2QueryKerningPairs(HPS hps, LONG lCount, PKERNINGPAIRS akrnprData);
336BOOL APIENTRY Ft2LoadPublicFonts(HAB hab, PSZ psz);
337BOOL APIENTRY Ft2UnloadPublicFonts(HAB hab, PSZ psz);
338LONG APIENTRY Ft2CharString(HPS hps, LONG lCount, PCH pchString);
339LONG APIENTRY Ft2CharStringAt(HPS hps, PPOINTL pptlPoint, LONG lCount,
340 PCH pchString);
341LONG APIENTRY Ft2CharStringPos(HPS hps, PRECTL prclRect, ULONG flOptions,
342 LONG lCount, PCH pchString, PLONG alAdx);
343LONG APIENTRY Ft2CharStringPosAt(HPS hps, PPOINTL pptlStart, PRECTL prclRect,
344 ULONG flOptions, LONG lCount, PCH pchString,
345 PLONG alAdx);
346LONG APIENTRY Ft2CharStringPosAtA(HPS hps, PPOINTL pptlStart, PRECTL prclRect,
347 ULONG flOptions, LONG lCount, PCH pchString, PLONG alAdx, ULONG fuWin32Options);
348LONG APIENTRY Ft2CharStringPosAtW(HPS hps, PPOINTL pptlStart, PRECTL prclRect,
349 ULONG flOptions, LONG lCount, LPWSTR pchString, PLONG alAdx, ULONG fuWin32Options);
350BOOL APIENTRY Ft2QueryCharStringPosAtA(HPS hps, PPOINTL pptlStart, ULONG flOptions, LONG lCount,
351 PCH pchString, PLONG alXincrements, PPOINTL aptlPositions);
352BOOL APIENTRY Ft2QueryCharStringPosAtW(HPS hps, PPOINTL pptlStart, ULONG flOptions, LONG lCount,
353 LPWSTR pchString, PLONG alXincrements, PPOINTL aptlPositions);
354HBITMAP APIENTRY Ft2SetBitmap(HPS hps, HBITMAP hbm);
355BOOL APIENTRY Ft2SetCp(HPS hps, ULONG ulCodePage);
356ULONG APIENTRY Ft2QueryCp(HPS hps);
357
358/** @name Additional APIs
359 * @{ */
360BOOL APIENTRY Ft2FontSupportsUnicodeChar(HPS hps, LONG lLcid, BOOL isUnicode, WCHAR ch);
361BOOL APIENTRY Ft2FontSupportsUnicodeChar1(PSTR8 pName, PFATTRS pfatAttrs, BOOL isUnicode, WCHAR ch);
362LONG APIENTRY Ft2AddFontResourceEx(PSZ lpszFilename, ULONG fl, PVOID pdv);
363LONG APIENTRY Ft2RemoveFontResourceEx(PSZ lpszFilename, ULONG fl, PVOID pdv);
364ULONG APIENTRY Ft2GetFontData(HPS hps, ULONG dwTable, ULONG dwOffset,
365 PVOID lpvBuffer, ULONG cbData);
366ULONG APIENTRY Ft2GetGlyphIndices(HPS hps, LPWSTR str, int c,
367 USHORT *pgi, ULONG fl);
368
369ULONG APIENTRY Ft2GetGlyphOutline(HPS hps, UINT glyph, UINT format,
370 LPGLYPHMETRICS lpgm, ULONG buflen, void* buf,
371 const MAT2* lpmat);
372
373BOOL APIENTRY Ft2GetTextExtentW(HPS hps, LONG lCount1, LPWSTR pchString,
374 LONG lCount2, PPOINTL aptlPoints);
375
376ULONG APIENTRY Ft2QueryFontType(HPS hps, PSZ lpszFontName);
377
378BOOL APIENTRY Ft2LoadPrivateFonts(HAB hab, PSZ psz);
379BOOL APIENTRY Ft2UnloadPrivateFonts(HAB hab, PSZ psz);
380
381void APIENTRY Ft2RegisterUconv(PFN_WIDECHARTOMULTIBYTE pfnWideCharToMultiByte, PFN_MULTIBYTETOWIDECHAR pfnMultiByteToWideChar);
382
383BOOL APIENTRY Ft2QueryStringWidthW(HPS hps, LPWSTR lpszString, UINT cbString, LONG *pWidthArray);
384
385DWORD APIENTRY Ft2GetCharacterPlacementW(HPS hps, LPCWSTR lpString, int uCount,
386 int nMaxExtent, GCP_RESULTSW *lpResults,
387 DWORD dwFlags);
388
389/* PMWIN replacements */
390HPS APIENTRY Ft2BeginPaint(HWND hwnd, HPS hps, PRECTL prclPaint);
391BOOL APIENTRY Ft2EndPaint(HPS hps);
392HPS APIENTRY Ft2GetPS(HWND hwnd);
393BOOL APIENTRY Ft2ReleasePS(HPS hps);
394HPS APIENTRY Ft2GetClipPS(HWND hwnd, HWND hwndClip, ULONG fl);
395HPS APIENTRY Ft2GetScreenPS(HWND hwndDesktop);
396LONG APIENTRY Ft2DrawTextA(HPS hps, LONG cchText, PCH lpchText, PRECTL prcl, LONG clrFore, LONG clrBack, ULONG flCmd);
397
398BOOL APIENTRY Ft2EnableFontEngine(BOOL fEnable);
399
400/** @} */
401
402#endif // __H_FT2LIB
Note: See TracBrowser for help on using the repository browser.