Added version info to 16-bit shell.dll.
[wine/multimedia.git] / graphics / fontengine.c
blob606eefda56728059bf5132c5d28e89623a4c1ffe
1 /*
2 * True Type font engine support
4 * Copyright 1996 John Harvey
5 * Copyright 1998 David Lee Lambert
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #include <math.h>
22 #include <stdio.h>
23 #include <stdlib.h>
24 #include "winbase.h"
25 #include "font.h"
26 #include "wine/debug.h"
28 WINE_DEFAULT_DEBUG_CHANNEL(font);
30 /***********************************************************************
31 * EngineEnumerateFont (GDI.300)
33 WORD WINAPI
34 EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
36 FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
37 return 0;
40 /***********************************************************************
41 * EngineDeleteFont (GDI.301)
43 WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
45 WORD handle;
47 /* untested, don't know if it works.
48 We seem to access some structure that is located after the
49 FONTINFO. The FONTINFO documentation says that there may
50 follow some char-width table or font bitmap or vector info.
51 I think it is some kind of font bitmap that begins at offset 0x52,
52 as FONTINFO goes up to 0x51.
53 If this is correct, everything should be implemented correctly.
55 if ( ((lpFontInfo->dfType & (RASTER_FONTTYPE|DEVICE_FONTTYPE))
56 == (RASTER_FONTTYPE|DEVICE_FONTTYPE))
57 && (LOWORD(lpFontInfo->dfFace) == LOWORD(lpFontInfo)+0x6e)
58 && (handle = *(WORD *)(lpFontInfo+0x54)) )
60 *(WORD *)(lpFontInfo+0x54) = 0;
61 GlobalFree16(handle);
63 return 1;
66 /***********************************************************************
67 * EngineRealizeFont (GDI.302)
69 WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
71 FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
73 return 0;
76 /***********************************************************************
77 * EngineRealizeFontExt (GDI.315)
79 WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4)
81 FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4);
83 return 0;
86 /***********************************************************************
87 * EngineGetCharWidth (GDI.303)
89 WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
91 int i;
93 for (i = firstChar; i <= lastChar; i++)
94 FIXME(" returns font's average width for range %d to %d\n", firstChar, lastChar);
95 *buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
96 return 1;
99 /***********************************************************************
100 * EngineSetFontContext (GDI.304)
102 WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
104 FIXME("stub?\n");
105 return 0;
108 /***********************************************************************
109 * EngineGetGlyphBMP (GDI.305)
111 WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
113 FIXME("stub?\n");
114 return 0;
117 /***********************************************************************
118 * EngineMakeFontDir (GDI.306)
120 DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
122 FIXME(" stub! (always fails)\n");
123 return -1; /* error */