Separated stuff for shv background contextmenu to separate file.
[wine.git] / graphics / fontengine.c
blob51f1b92b6e54e1b3da1fa3b5db72fe7698732806
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)
19 /* ****************************************************************
20 * EngineEnumerateFont [GDI.300]
22 WORD WINAPI
23 EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
25 FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
26 return 0;
29 /* ****************************************************************
30 * EngineDeleteFont [GDI.301]
32 WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
34 WORD handle;
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.
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)) )
49 *(WORD *)(lpFontInfo+0x54) = 0;
50 GlobalFree16(handle);
52 return 1;
55 /* ****************************************************************
56 * EngineRealizeFont [GDI.302]
58 WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
60 FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
62 return 0;
65 /* ****************************************************************
66 * EngineGetCharWidth [GDI.303]
68 WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
70 int i;
72 for (i = firstChar; i <= lastChar; i++)
73 FIXME(" 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;
78 /* ****************************************************************
79 * EngineSetFontContext [GDI.304]
81 WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
83 FIXME("stub?\n");
84 return 0;
87 /* ****************************************************************
88 * EngineGetGlyphBMP [GDI.305]
90 WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
92 FIXME("stub?\n");
93 return 0;
96 /* ****************************************************************
97 * EngineMakeFontDir [GDI.306]
99 DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
101 FIXME(" stub! (always fails)\n");
102 return -1; /* error */
106 /* ****************************************************************
107 * EngineExtTextOut [GDI.314]
110 WORD WINAPI EngineExtTextOut()
112 FIXME("stub!\n");
113 return 0;