Commit 23c7c046 authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Reimplement GetCharABCWidthsFloat using the integer version.

parent 27208a0e
......@@ -3049,6 +3049,8 @@ BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT a
BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf )
{
UINT i;
ABC *abc;
PHYSDEV dev;
BOOL ret = FALSE;
DC *dc = get_dc_ptr( hdc );
......@@ -3056,28 +3058,24 @@ BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT a
if (!dc) return FALSE;
if (!abcf)
{
release_dc_ptr( dc );
return FALSE;
}
if (dc->gdiFont)
ret = WineEngGetCharABCWidthsFloat( dc->gdiFont, first, last, abcf );
else
FIXME("stub\n");
if (!abcf) goto done;
if (!(abc = HeapAlloc( GetProcessHeap(), 0, (last - first + 1) * sizeof(*abc) ))) goto done;
dev = GET_DC_PHYSDEV( dc, pGetCharABCWidths );
ret = dev->funcs->pGetCharABCWidths( dev, first, last, abc );
if (ret)
{
/* convert device units to logical */
for (i = first; i <= last; i++, abcf++)
{
abcf->abcfA = abcf->abcfA * dc->xformVport2World.eM11;
abcf->abcfB = abcf->abcfB * dc->xformVport2World.eM11;
abcf->abcfC = abcf->abcfC * dc->xformVport2World.eM11;
abcf->abcfA = abc->abcA * dc->xformVport2World.eM11;
abcf->abcfB = abc->abcB * dc->xformVport2World.eM11;
abcf->abcfC = abc->abcC * dc->xformVport2World.eM11;
}
}
HeapFree( GetProcessHeap(), 0, abc );
done:
release_dc_ptr( dc );
return ret;
}
......
......@@ -6387,38 +6387,6 @@ static BOOL freetype_GetCharABCWidths( PHYSDEV dev, UINT firstChar, UINT lastCha
}
/*************************************************************
* WineEngGetCharABCWidthsFloat
*
*/
BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer)
{
static const MAT2 identity = {{0,1}, {0,0}, {0,0}, {0,1}};
UINT c;
GLYPHMETRICS gm;
FT_UInt glyph_index;
GdiFont *linked_font;
TRACE("%p, %d, %d, %p\n", font, first, last, buffer);
GDI_CheckNotLock();
EnterCriticalSection( &freetype_cs );
for (c = first; c <= last; c++)
{
get_glyph_index_linked(font, c, &linked_font, &glyph_index);
get_glyph_outline(linked_font, glyph_index, GGO_METRICS | GGO_GLYPH_INDEX,
&gm, 0, NULL, &identity);
buffer[c - first].abcfA = FONT_GM(linked_font, glyph_index)->lsb;
buffer[c - first].abcfB = FONT_GM(linked_font, glyph_index)->bbx;
buffer[c - first].abcfC = FONT_GM(linked_font, glyph_index)->adv -
FONT_GM(linked_font, glyph_index)->lsb -
FONT_GM(linked_font, glyph_index)->bbx;
}
LeaveCriticalSection( &freetype_cs );
return TRUE;
}
/*************************************************************
* freetype_GetCharABCWidthsI
*/
static BOOL freetype_GetCharABCWidthsI( PHYSDEV dev, UINT firstChar, UINT count, LPWORD pgi, LPABC buffer )
......@@ -7228,12 +7196,6 @@ UINT WineEngGetOutlineTextMetrics(GdiFont *font, UINT cbSize,
return 0;
}
BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer)
{
ERR("called but we don't have FreeType\n");
return FALSE;
}
BOOL WineEngGetTextExtentExPointI(GdiFont *font, const WORD *indices, INT count,
INT max_ext, LPINT nfit, LPINT dx, LPSIZE size)
{
......
......@@ -292,8 +292,6 @@ typedef struct
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 BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT firstChar,
UINT lastChar, LPABCFLOAT buffer) 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,
......
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