Added timeout to critical section waiting.
[wine/multimedia.git] / graphics / fontengine.c
blob9b672dcc7d2989b79562bf60a1f3fb5dd04508be
1 /*
2 * True Type font engine support
4 * Copyright 1996 John Harvey
5 * Copyright 1998 David Lee Lambert
6 *
7 */
8 #include <math.h>
9 #include <stdio.h>
10 #include <stdlib.h>
11 #include "winbase.h"
12 #include "font.h"
13 #include "debug.h"
17 /* ****************************************************************
18 * EngineEnumerateFont [GDI.300]
20 WORD WINAPI
21 EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
23 FIXME(font,"(%s,%p,%lx),stub\n",fontname,proc,data);
24 return 0;
27 /* ****************************************************************
28 * EngineDeleteFont [GDI.301]
30 WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
32 WORD handle;
34 /* untested, don't know if it works.
35 We seem to access some structure that is located after the
36 FONTINFO. The FONTINFO documentation says that there may
37 follow some char-width table or font bitmap or vector info.
38 I think it is some kind of font bitmap that begins at offset 0x52,
39 as FONTINFO goes up to 0x51.
40 If this is correct, everything should be implemented correctly.
42 if ( ((lpFontInfo->dfType & (RASTER_FONTTYPE|DEVICE_FONTTYPE))
43 == (RASTER_FONTTYPE|DEVICE_FONTTYPE))
44 && (LOWORD(lpFontInfo->dfFace) == LOWORD(lpFontInfo)+0x6e)
45 && (handle = *(WORD *)(lpFontInfo+0x54)) )
47 *(WORD *)(lpFontInfo+0x54) = 0;
48 GlobalFree16(handle);
50 return 1;
53 /* ****************************************************************
54 * EngineRealizeFont [GDI.302]
56 WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
58 FIXME(font,"(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
60 return 0;
63 /* ****************************************************************
64 * EngineGetCharWidth [GDI.303]
66 WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
68 int i;
70 for (i = firstChar; i <= lastChar; i++)
71 FIXME(font, " returns font's average width for range %d to %d\n", firstChar, lastChar);
72 *buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
73 return 1;
76 /* ****************************************************************
77 * EngineSetFontContext [GDI.304]
79 WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
81 FIXME(font, "stub?\n");
82 return 0;
85 /* ****************************************************************
86 * EngineGetGlyphBMP [GDI.305]
88 WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
90 FIXME(font, "stub?\n");
91 return 0;
94 /* ****************************************************************
95 * EngineMakeFontDir [GDI.306]
97 DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
99 FIXME(font, " stub! (always fails)\n");
100 return -1; /* error */
104 /* ****************************************************************
105 * EngineExtTextOut [GDI.314]
108 WORD WINAPI EngineExtTextOut()
110 FIXME(font, "stub!\n");
111 return 0;