Commit 1740f34f authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Implement GetTextCharsetInfo as a standard driver entry point.

parent ce8d7b46
......@@ -472,10 +472,7 @@ HFONT WINAPI CreateFontW( INT height, INT width, INT esc,
static void update_font_code_page( DC *dc )
{
CHARSETINFO csi;
int charset = DEFAULT_CHARSET;
if (dc->gdiFont)
charset = WineEngGetTextCharsetInfo( dc->gdiFont, NULL, 0 );
int charset = GetTextCharsetInfo( dc->hSelf, NULL, 0 );
/* Hmm, nicely designed api this one! */
if (TranslateCharsetInfo( ULongToPtr(charset), &csi, TCI_SRCCHARSET) )
......@@ -3261,12 +3258,12 @@ UINT WINAPI GetTextCharsetInfo(HDC hdc, LPFONTSIGNATURE fs, DWORD flags)
{
UINT ret = DEFAULT_CHARSET;
DC *dc = get_dc_ptr(hdc);
PHYSDEV dev;
if (dc)
{
if (dc->gdiFont)
ret = WineEngGetTextCharsetInfo(dc->gdiFont, fs, flags);
dev = GET_DC_PHYSDEV( dc, pGetTextCharsetInfo );
ret = dev->funcs->pGetTextCharsetInfo( dev, fs, flags );
release_dc_ptr( dc );
}
......
......@@ -6602,10 +6602,20 @@ INT WineEngGetTextFace(GdiFont *font, INT count, LPWSTR str)
return n;
}
UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags)
/*************************************************************
* freetype_GetTextCharsetInfo
*/
static UINT freetype_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags )
{
if (fs) *fs = font->fs;
return font->charset;
struct freetype_physdev *physdev = get_freetype_dev( dev );
if (!physdev->font)
{
dev = GET_NEXT_PHYSDEV( dev, pGetTextCharsetInfo );
return dev->funcs->pGetTextCharsetInfo( dev, fs, flags );
}
if (fs) *fs = physdev->font->fs;
return physdev->font->charset;
}
BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
......@@ -7119,7 +7129,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pGetPixel */
NULL, /* pGetPixelFormat */
NULL, /* pGetSystemPaletteEntries */
NULL, /* pGetTextCharsetInfo */
freetype_GetTextCharsetInfo, /* pGetTextCharsetInfo */
freetype_GetTextExtentExPoint, /* pGetTextExtentExPoint */
NULL, /* pGetTextExtentExPointI */
NULL, /* pGetTextFace */
......@@ -7249,12 +7259,6 @@ HANDLE WineEngAddFontMemResourceEx(PVOID pbFont, DWORD cbFont, PVOID pdv, DWORD
return NULL;
}
UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags)
{
FIXME("(%p, %p, %u): stub\n", font, fs, flags);
return DEFAULT_CHARSET;
}
BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
{
return FALSE;
......
......@@ -294,7 +294,6 @@ extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC
extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN;
extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN;
extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN;
extern UINT WineEngGetTextCharsetInfo(GdiFont *font, LPFONTSIGNATURE fs, DWORD flags) DECLSPEC_HIDDEN;
extern BOOL WineEngGetTextExtentExPointI(GdiFont*, const WORD *, INT, INT, LPINT, LPINT, LPSIZE) DECLSPEC_HIDDEN;
extern INT WineEngGetTextFace(GdiFont*, INT, LPWSTR) DECLSPEC_HIDDEN;
extern BOOL WineEngFontIsLinked(GdiFont*) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment