Implement GetFontData.

This commit is contained in:
Huw D M Davies 2001-10-23 20:06:32 +00:00 committed by Alexandre Julliard
parent 2843934af5
commit 4e2024e8a8
6 changed files with 202 additions and 145 deletions

275
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -414,7 +414,8 @@ else
freetype/ftnames.h \
freetype/ftsnames.h \
freetype/ttnameid.h \
freetype/ftoutln.h)
freetype/ftoutln.h \
freetype/internal/sfnt.h)
CPPFLAGS="$ac_save_CPPFLAGS"
wine_cv_msg_freetype=no
fi

View File

@ -21,6 +21,7 @@
#include <string.h>
#include <dirent.h>
#include <stdio.h>
#include <assert.h>
DEFAULT_DEBUG_CHANNEL(font);
@ -47,6 +48,9 @@ DEFAULT_DEBUG_CHANNEL(font);
#ifdef HAVE_FREETYPE_FTOUTLN_H
#include <freetype/ftoutln.h>
#endif
#ifdef HAVE_FREETYPE_INTERNAL_SFNT_H
#include <freetype/internal/sfnt.h>
#endif
static FT_Library library = 0;
@ -770,6 +774,43 @@ BOOL WineEngGetTextExtentPoint(GdiFont font, LPCWSTR wstr, INT count,
return TRUE;
}
/*************************************************************
* WineEngGetFontData
*
*/
DWORD WineEngGetFontData(GdiFont font, DWORD table, DWORD offset, LPVOID buf,
DWORD cbData)
{
FT_Face ft_face = font->ft_face;
TT_Face tt_face;
SFNT_Interface *sfnt;
DWORD len;
FT_Error err;
if(!FT_IS_SFNT(ft_face))
return GDI_ERROR;
tt_face = (TT_Face) ft_face;
sfnt = (SFNT_Interface*)tt_face->sfnt;
if(!buf || !cbData)
len = 0;
else
len = cbData;
if(table) { /* MS tags differ in endidness from FT ones */
table = table >> 24 | table << 24 |
(table >> 8 & 0xff00) | (table << 8 & 0xff0000);
}
err = sfnt->load_any(tt_face, table, offset, buf, &len);
if(err) {
ERR("Can't find table %08lx\n", table);
return GDI_ERROR;
}
return len;
}
#else /* HAVE_FREETYPE */
BOOL WineEngInit(void)
@ -831,5 +872,11 @@ BOOL WineEngGetTextExtentPoint(GdiFont font, LPCWSTR wstr, INT count,
return FALSE;
}
DWORD WineEngGetFontData(GdiFont font, DWORD table, DWORD offset, LPVOID buf,
DWORD cbData)
{
ERR("called but we don't have FreeType\n");
return GDI_ERROR;
}
#endif /* HAVE_FREETYPE */

View File

@ -1,4 +1,4 @@
/* include/config.h.in. Generated automatically from configure.in by autoheader. */
/* include/config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* Define if using alloca.c. */
#undef C_ALLOCA
@ -238,6 +238,9 @@
/* Define if you have the <freetype/ftsnames.h> header file. */
#undef HAVE_FREETYPE_FTSNAMES_H
/* Define if you have the <freetype/internal/sfnt.h> header file. */
#undef HAVE_FREETYPE_INTERNAL_SFNT_H
/* Define if you have the <freetype/ttnameid.h> header file. */
#undef HAVE_FREETYPE_TTNAMEID_H

View File

@ -78,6 +78,7 @@ extern GdiFont WineEngCreateFontInstance(HFONT);
extern DWORD WineEngDecRefFont(GdiFont);
extern DWORD WineEngEnumFonts(LPLOGFONTW, DEVICEFONTENUMPROC, LPARAM);
extern BOOL WineEngGetCharWidth(GdiFont, UINT, UINT, LPINT);
extern DWORD WineEngGetFontData(GdiFont, DWORD, DWORD, LPVOID, DWORD);
extern DWORD WineEngGetGlyphOutline(GdiFont, UINT glyph, UINT format,
LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
const MAT2*);

View File

@ -1895,16 +1895,20 @@ DWORD WINAPI GetFontLanguageInfo16(HDC16 hdc) {
*
* Calls SetLastError()
*
* BUGS
*
* Unimplemented
*/
DWORD WINAPI GetFontData(HDC hdc, DWORD table, DWORD offset,
LPVOID buffer, DWORD length)
{
FIXME("(%x,%ld,%ld,%p,%ld): stub\n", hdc, table, offset, buffer, length);
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
return GDI_ERROR;
DC *dc = DC_GetDCPtr(hdc);
DWORD ret = GDI_ERROR;
if(!dc) return GDI_ERROR;
if(dc->gdiFont)
ret = WineEngGetFontData(dc->gdiFont, table, offset, buffer, length);
GDI_ReleaseObj(hdc);
return ret;
}
/*************************************************************************