gdi32: Implement GetGlyphIndices as a standard driver entry point.

This commit is contained in:
Alexandre Julliard 2011-10-20 16:30:32 +02:00
parent 90ecea9739
commit ff96c4dd4e
3 changed files with 19 additions and 22 deletions

View File

@ -2837,16 +2837,16 @@ DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count,
LPWORD pgi, DWORD flags)
{
DC *dc = get_dc_ptr(hdc);
DWORD ret = GDI_ERROR;
PHYSDEV dev;
DWORD ret;
TRACE("(%p, %s, %d, %p, 0x%x)\n",
hdc, debugstr_wn(lpstr, count), count, pgi, flags);
if(!dc) return GDI_ERROR;
if(dc->gdiFont)
ret = WineEngGetGlyphIndices(dc->gdiFont, lpstr, count, pgi, flags);
dev = GET_DC_PHYSDEV( dc, pGetGlyphIndices );
ret = dev->funcs->pGetGlyphIndices( dev, lpstr, count, pgi, flags );
release_dc_ptr( dc );
return ret;
}

View File

@ -4947,16 +4947,21 @@ static FT_UInt get_glyph_index(const GdiFont *font, UINT glyph)
}
/*************************************************************
* WineEngGetGlyphIndices
*
* freetype_GetGlyphIndices
*/
DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
LPWORD pgi, DWORD flags)
static DWORD freetype_GetGlyphIndices( PHYSDEV dev, LPCWSTR lpstr, INT count, LPWORD pgi, DWORD flags )
{
struct freetype_physdev *physdev = get_freetype_dev( dev );
int i;
WORD default_char;
BOOL got_default = FALSE;
if (!physdev->font)
{
dev = GET_NEXT_PHYSDEV( dev, pGetGlyphIndices );
return dev->funcs->pGetGlyphIndices( dev, lpstr, count, pgi, flags );
}
if (flags & GGI_MARK_NONEXISTING_GLYPHS)
{
default_char = 0xffff; /* XP would use 0x1f for bitmap fonts */
@ -4968,20 +4973,20 @@ DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
for(i = 0; i < count; i++)
{
pgi[i] = get_glyph_index(font, lpstr[i]);
pgi[i] = get_glyph_index(physdev->font, lpstr[i]);
if (pgi[i] == 0)
{
if (!got_default)
{
if (FT_IS_SFNT(font->ft_face))
if (FT_IS_SFNT(physdev->font->ft_face))
{
TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(font->ft_face, ft_sfnt_os2);
default_char = (pOS2->usDefaultChar ? get_glyph_index(font, pOS2->usDefaultChar) : 0);
TT_OS2 *pOS2 = pFT_Get_Sfnt_Table(physdev->font->ft_face, ft_sfnt_os2);
default_char = (pOS2->usDefaultChar ? get_glyph_index(physdev->font, pOS2->usDefaultChar) : 0);
}
else
{
TEXTMETRICW textm;
get_text_metrics(font, &textm);
get_text_metrics(physdev->font, &textm);
default_char = textm.tmDefaultChar;
}
got_default = TRUE;
@ -7083,7 +7088,7 @@ static const struct gdi_dc_funcs freetype_funcs =
NULL, /* pGetDeviceGammaRamp */
NULL, /* pGetFontData */
freetype_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */
NULL, /* pGetGlyphIndices */
freetype_GetGlyphIndices, /* pGetGlyphIndices */
NULL, /* pGetGlyphOutline */
NULL, /* pGetICMProfile */
NULL, /* pGetImage */
@ -7185,12 +7190,6 @@ BOOL WineEngDestroyFontInstance(HFONT hfont)
return FALSE;
}
DWORD WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
LPWORD pgi, DWORD flags)
{
return GDI_ERROR;
}
DWORD WineEngGetGlyphOutline(GdiFont *font, UINT glyph, UINT format,
LPGLYPHMETRICS lpgm, DWORD buflen, LPVOID buf,
const MAT2* lpmat)

View File

@ -293,8 +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 WineEngGetGlyphIndices(GdiFont *font, LPCWSTR lpstr, INT count,
LPWORD pgi, DWORD flags) DECLSPEC_HIDDEN;
extern DWORD WineEngGetGlyphOutline(GdiFont*, UINT glyph, UINT format,
LPGLYPHMETRICS, DWORD buflen, LPVOID buf,
const MAT2*) DECLSPEC_HIDDEN;