blob: 606eefda56728059bf5132c5d28e89623a4c1ffe [file] [log] [blame]
Alexandre Julliard01d63461997-01-20 19:43:45 +00001/*
2 * True Type font engine support
3 *
4 * Copyright 1996 John Harvey
Alexandre Julliard46ea8b31998-05-03 19:01:20 +00005 * Copyright 1998 David Lee Lambert
Alexandre Julliard0799c1a2002-03-09 23:29:33 +00006 *
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.
11 *
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.
16 *
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
Alexandre Julliard01d63461997-01-20 19:43:45 +000020 */
Marcus Meissner6b9dd2e1999-03-18 17:39:57 +000021#include <math.h>
Alexandre Julliard01d63461997-01-20 19:43:45 +000022#include <stdio.h>
23#include <stdlib.h>
Marcus Meissner04c3e1d1999-02-19 10:37:02 +000024#include "winbase.h"
Alexandre Julliard03468f71998-02-15 19:40:49 +000025#include "font.h"
Vincent Béron9a624912002-05-31 23:06:46 +000026#include "wine/debug.h"
Alexandre Julliard01d63461997-01-20 19:43:45 +000027
Alexandre Julliard0799c1a2002-03-09 23:29:33 +000028WINE_DEFAULT_DEBUG_CHANNEL(font);
Patrik Stridvallb4b9fae1999-04-19 14:56:29 +000029
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000030/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +000031 * EngineEnumerateFont (GDI.300)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000032 */
Vincent Béron9a624912002-05-31 23:06:46 +000033WORD WINAPI
Alexandre Julliarda3960291999-02-26 11:11:13 +000034EngineEnumerateFont16(LPSTR fontname, FARPROC16 proc, DWORD data )
Alexandre Julliard01d63461997-01-20 19:43:45 +000035{
Alexandre Julliard61fece01999-06-26 19:09:08 +000036 FIXME("(%s,%p,%lx),stub\n",fontname,proc,data);
Alexandre Julliard01d63461997-01-20 19:43:45 +000037 return 0;
38}
Alexandre Julliard03468f71998-02-15 19:40:49 +000039
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000040/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +000041 * EngineDeleteFont (GDI.301)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000042 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000043WORD WINAPI EngineDeleteFont16(LPFONTINFO16 lpFontInfo)
Alexandre Julliard01d63461997-01-20 19:43:45 +000044{
Alexandre Julliard03468f71998-02-15 19:40:49 +000045 WORD handle;
46
47 /* untested, don't know if it works.
48 We seem to access some structure that is located after the
Vincent Béron9a624912002-05-31 23:06:46 +000049 FONTINFO. The FONTINFO documentation says that there may
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000050 follow some char-width table or font bitmap or vector info.
Alexandre Julliard03468f71998-02-15 19:40:49 +000051 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.
54 */
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)) )
59 {
60 *(WORD *)(lpFontInfo+0x54) = 0;
61 GlobalFree16(handle);
62 }
63 return 1;
Alexandre Julliard01d63461997-01-20 19:43:45 +000064}
Alexandre Julliard03468f71998-02-15 19:40:49 +000065
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000066/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +000067 * EngineRealizeFont (GDI.302)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000068 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000069WORD WINAPI EngineRealizeFont16(LPLOGFONT16 lplogFont, LPTEXTXFORM16 lptextxform, LPFONTINFO16 lpfontInfo)
Alexandre Julliard01d63461997-01-20 19:43:45 +000070{
Alexandre Julliard61fece01999-06-26 19:09:08 +000071 FIXME("(%p,%p,%p),stub\n",lplogFont,lptextxform,lpfontInfo);
Vincent Béron9a624912002-05-31 23:06:46 +000072
Alexandre Julliard01d63461997-01-20 19:43:45 +000073 return 0;
74}
Alexandre Julliard03468f71998-02-15 19:40:49 +000075
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000076/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +000077 * EngineRealizeFontExt (GDI.315)
Huw D M Davies0f298851999-10-31 01:46:21 +000078 */
79WORD WINAPI EngineRealizeFontExt16(LONG l1, LONG l2, LONG l3, LONG l4)
80{
81 FIXME("(%08lx,%08lx,%08lx,%08lx),stub\n",l1,l2,l3,l4);
Vincent Béron9a624912002-05-31 23:06:46 +000082
Huw D M Davies0f298851999-10-31 01:46:21 +000083 return 0;
84}
85
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000086/***********************************************************************
Patrik Stridvall01d5e5b2001-07-02 19:59:40 +000087 * EngineGetCharWidth (GDI.303)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +000088 */
Alexandre Julliarda3960291999-02-26 11:11:13 +000089WORD WINAPI EngineGetCharWidth16(LPFONTINFO16 lpFontInfo, BYTE firstChar, BYTE lastChar, LPINT16 buffer)
Alexandre Julliard01d63461997-01-20 19:43:45 +000090{
Alexandre Julliard03468f71998-02-15 19:40:49 +000091 int i;
92
93 for (i = firstChar; i <= lastChar; i++)
Alexandre Julliard61fece01999-06-26 19:09:08 +000094 FIXME(" returns font's average width for range %d to %d\n", firstChar, lastChar);
Alexandre Julliard03468f71998-02-15 19:40:49 +000095 *buffer++ = lpFontInfo->dfAvgWidth; /* insert some charwidth functionality here; use average width for now */
96 return 1;
Alexandre Julliard01d63461997-01-20 19:43:45 +000097}
98
Patrik Stridvall2d6457c2000-03-28 20:22:59 +000099/***********************************************************************
100 * EngineSetFontContext (GDI.304)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000101 */
Alexandre Julliard03468f71998-02-15 19:40:49 +0000102WORD WINAPI EngineSetFontContext(LPFONTINFO16 lpFontInfo, WORD data)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000103{
Alexandre Julliard61fece01999-06-26 19:09:08 +0000104 FIXME("stub?\n");
Alexandre Julliard03468f71998-02-15 19:40:49 +0000105 return 0;
Alexandre Julliard01d63461997-01-20 19:43:45 +0000106}
Alexandre Julliard03468f71998-02-15 19:40:49 +0000107
Patrik Stridvall2d6457c2000-03-28 20:22:59 +0000108/***********************************************************************
109 * EngineGetGlyphBMP (GDI.305)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000110 */
Alexandre Julliard03468f71998-02-15 19:40:49 +0000111WORD WINAPI EngineGetGlyphBMP(WORD word, LPFONTINFO16 lpFontInfo, WORD w1, WORD w2, LPSTR string, DWORD dword, /*LPBITMAPMETRICS16*/ LPVOID metrics)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000112{
Alexandre Julliard61fece01999-06-26 19:09:08 +0000113 FIXME("stub?\n");
Alexandre Julliard01d63461997-01-20 19:43:45 +0000114 return 0;
115}
116
Patrik Stridvall2d6457c2000-03-28 20:22:59 +0000117/***********************************************************************
118 * EngineMakeFontDir (GDI.306)
Alexandre Julliard46ea8b31998-05-03 19:01:20 +0000119 */
Alexandre Julliard03468f71998-02-15 19:40:49 +0000120DWORD WINAPI EngineMakeFontDir(HDC16 hdc, LPFONTDIR16 fontdir, LPCSTR string)
Alexandre Julliard01d63461997-01-20 19:43:45 +0000121{
Alexandre Julliard61fece01999-06-26 19:09:08 +0000122 FIXME(" stub! (always fails)\n");
Alexandre Julliard03468f71998-02-15 19:40:49 +0000123 return -1; /* error */
Vincent Béron9a624912002-05-31 23:06:46 +0000124
Alexandre Julliard01d63461997-01-20 19:43:45 +0000125}