Converted to the new debugging interface (done with the help of the
[wine] / graphics / fontengine.c
1 /*
2  * True Type font engine support
3  *
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"     
14
15 DEFAULT_DEBUG_CHANNEL(font)
16
17
18
19 /* **************************************************************** 
20  *    EngineEnumerateFont [GDI.300] 
21  */
22 WORD WINAPI 
23 EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
24 {
25     FIXME(font,"(%s,%p,%lx),stub\n",fontname,proc,data);
26     return 0;
27 }
28
29 /* **************************************************************** 
30  *   EngineDeleteFont [GDI.301] 
31  */
32 WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
33 {
34     WORD handle;
35
36     /*  untested, don't know if it works.
37         We seem to access some structure that is located after the
38         FONTINFO. The FONTINFO documentation says that there may 
39         follow some char-width table or font bitmap or vector info.
40         I think it is some kind of font bitmap that begins at offset 0x52,
41         as FONTINFO goes up to 0x51.
42         If this is correct, everything should be implemented correctly.
43     */
44     if ( ((lpFontInfo->dfType & (RASTER_FONTTYPE|DEVICE_FONTTYPE))
45       == (RASTER_FONTTYPE|DEVICE_FONTTYPE))
46         && (LOWORD(lpFontInfo->dfFace) == LOWORD(lpFontInfo)+0x6e)
47         && (handle = *(WORD *)(lpFontInfo+0x54)) )
48     {
49         *(WORD *)(lpFontInfo+0x54) = 0;
50         GlobalFree16(handle);
51     }
52     return 1;
53 }
54
55 /* ****************************************************************
56  *       EngineRealizeFont [GDI.302] 
57  */
58 WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
59 {
60     FIXME(font,"(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
61     
62     return 0;
63 }
64
65 /* ****************************************************************
66  *        EngineGetCharWidth [GDI.303] 
67  */
68 WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
69 {
70     int i;
71
72     for (i = firstChar; i <= lastChar; i++)
73        FIXME(font, " returns font's average width for range %d to %d\n", firstChar, lastChar);
74         *buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
75     return 1;
76 }
77
78 /* ****************************************************************
79  *      EngineSetFontContext [GDI.304] 
80  */
81 WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
82 {
83    FIXME(font, "stub?\n");
84         return 0;
85 }
86
87 /* ****************************************************************
88  *       EngineGetGlyphBMP   [GDI.305] 
89  */
90 WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
91 {
92    FIXME(font, "stub?\n");
93     return 0;
94 }
95
96 /* ****************************************************************
97  *             EngineMakeFontDir  [GDI.306] 
98  */
99 DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
100 {
101    FIXME(font, " stub! (always fails)\n");
102     return -1; /* error */
103     
104 }
105
106 /* ****************************************************************
107  *              EngineExtTextOut [GDI.314] 
108  */
109
110 WORD WINAPI EngineExtTextOut()
111 {
112    FIXME(font, "stub!\n");
113     return 0;
114 }