Module: wine Branch: master Commit: 90ecea9739c1ca8585a97c1a4c1f65f4e141bed6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=90ecea9739c1ca8585a97c1a4c...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Oct 20 16:26:26 2011 +0200
gdi32: Implement GetFontUnicodeRanges as a standard driver entry point.
---
dlls/gdi32/font.c | 6 ++++-- dlls/gdi32/freetype.c | 24 ++++++++++++++---------- dlls/gdi32/gdi_private.h | 1 - 3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c index f2f4c94..72490c9 100644 --- a/dlls/gdi32/font.c +++ b/dlls/gdi32/font.c @@ -3397,14 +3397,16 @@ BOOL WINAPI GetCharWidthI(HDC hdc, UINT first, UINT count, LPWORD glyphs, LPINT */ DWORD WINAPI GetFontUnicodeRanges(HDC hdc, LPGLYPHSET lpgs) { - DWORD ret = 0; + DWORD ret; + PHYSDEV dev; DC *dc = get_dc_ptr(hdc);
TRACE("(%p, %p)\n", hdc, lpgs);
if (!dc) return 0;
- if (dc->gdiFont) ret = WineEngGetFontUnicodeRanges(dc->gdiFont, lpgs); + dev = GET_DC_PHYSDEV( dc, pGetFontUnicodeRanges ); + ret = dev->funcs->pGetFontUnicodeRanges( dev, lpgs ); release_dc_ptr(dc); return ret; } diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 5b3543b..11245d6 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -6675,11 +6675,21 @@ static DWORD get_font_unicode_ranges(FT_Face face, GLYPHSET *gs) return num_ranges; }
-DWORD WineEngGetFontUnicodeRanges(GdiFont *font, LPGLYPHSET glyphset) +/************************************************************* + * freetype_GetFontUnicodeRanges + */ +static DWORD freetype_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphset ) { - DWORD size = 0; - DWORD num_ranges = get_font_unicode_ranges(font->ft_face, glyphset); + struct freetype_physdev *physdev = get_freetype_dev( dev ); + DWORD size, num_ranges;
+ if (!physdev->font) + { + dev = GET_NEXT_PHYSDEV( dev, pGetFontUnicodeRanges ); + return dev->funcs->pGetFontUnicodeRanges( dev, glyphset ); + } + + num_ranges = get_font_unicode_ranges(physdev->font->ft_face, glyphset); size = sizeof(GLYPHSET) + sizeof(WCRANGE) * (num_ranges - 1); if (glyphset) { @@ -7072,7 +7082,7 @@ static const struct gdi_dc_funcs freetype_funcs = NULL, /* pGetDeviceCaps */ NULL, /* pGetDeviceGammaRamp */ NULL, /* pGetFontData */ - NULL, /* pGetFontUnicodeRanges */ + freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */ NULL, /* pGetGlyphIndices */ NULL, /* pGetGlyphOutline */ NULL, /* pGetICMProfile */ @@ -7245,12 +7255,6 @@ BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) return FALSE; }
-DWORD WineEngGetFontUnicodeRanges(GdiFont *font, LPGLYPHSET glyphset) -{ - FIXME("(%p, %p): stub\n", font, glyphset); - return 0; -} - BOOL WineEngFontIsLinked(GdiFont *font) { return FALSE; diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h index 23c1e78..316e6a9 100644 --- a/dlls/gdi32/gdi_private.h +++ b/dlls/gdi32/gdi_private.h @@ -293,7 +293,6 @@ extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN; extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN; extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN; extern DWORD WineEngGetFontData(GdiFont*, DWORD, DWORD, LPVOID, DWORD) DECLSPEC_HIDDEN; -extern DWORD WineEngGetFontUnicodeRanges(GdiFont *, LPGLYPHSET) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN; extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format,