Fix for 64-bit negative seek value.
[wine/multimedia.git] / graphics / fontengine.c
blobabf3346fa5418dc1dcd70422c1b834ee54d72c6f
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 "debugtools.h"
15 DEFAULT_DEBUG_CHANNEL(font);
17 /***********************************************************************
18 * EngineEnumerateFont16 (GDI.300)
20 WORD WINAPI
21 EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
23 FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
24 return 0;
27 /***********************************************************************
28 * EngineDeleteFont16 (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 * EngineRealizeFont16 (GDI.302)
56 WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
58 FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
60 return 0;
63 /***********************************************************************
64 * EngineRealizeFontExt16 (GDI.315)
66 WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4)
68 FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4);
70 return 0;
73 /***********************************************************************
74 * EngineGetCharWidth16 (GDI.303)
76 WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
78 int i;
80 for (i = firstChar; i <= lastChar; i++)
81 FIXME(" returns font's average width for range %d to %d\n", firstChar, lastChar);
82 *buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
83 return 1;
86 /***********************************************************************
87 * EngineSetFontContext (GDI.304)
89 WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
91 FIXME("stub?\n");
92 return 0;
95 /***********************************************************************
96 * EngineGetGlyphBMP (GDI.305)
98 WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
100 FIXME("stub?\n");
101 return 0;
104 /***********************************************************************
105 * EngineMakeFontDir (GDI.306)
107 DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
109 FIXME(" stub! (always fails)\n");
110 return -1; /* error */
114 /***********************************************************************
115 * EngineExtTextOut (GDI.314)
117 WORD WINAPI EngineExtTextOut()
119 FIXME("stub!\n");
120 return 0;