gdi32: Implement WineEngGetCharABCWidthsFloat and forward GetCharABCWidthsFloat to it.
This commit is contained in:
parent
49675df92e
commit
1d4fcc0270
|
@ -2908,34 +2908,40 @@ BOOL WINAPI GetCharABCWidthsFloatA( HDC hdc, UINT first, UINT last, LPABCFLOAT a
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*
|
|
||||||
* BUGS
|
|
||||||
* Only works with TrueType fonts. It also doesn't return real
|
|
||||||
* floats but converted integers because it's implemented on
|
|
||||||
* top of GetCharABCWidthsW.
|
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf )
|
BOOL WINAPI GetCharABCWidthsFloatW( HDC hdc, UINT first, UINT last, LPABCFLOAT abcf )
|
||||||
{
|
{
|
||||||
ABC *abc, *abc_base;
|
UINT i;
|
||||||
unsigned int i, size = sizeof(ABC) * (last - first + 1);
|
BOOL ret = FALSE;
|
||||||
BOOL ret;
|
DC *dc = get_dc_ptr( hdc );
|
||||||
|
|
||||||
TRACE("%p, %d, %d, %p - partial stub\n", hdc, first, last, abcf);
|
TRACE("%p, %d, %d, %p\n", hdc, first, last, abcf);
|
||||||
|
|
||||||
abc = abc_base = HeapAlloc( GetProcessHeap(), 0, size );
|
if (!dc) return FALSE;
|
||||||
if (!abc) return FALSE;
|
|
||||||
|
if (!abcf)
|
||||||
|
{
|
||||||
|
release_dc_ptr( dc );
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dc->gdiFont)
|
||||||
|
ret = WineEngGetCharABCWidthsFloat( dc->gdiFont, first, last, abcf );
|
||||||
|
else
|
||||||
|
FIXME("stub\n");
|
||||||
|
|
||||||
ret = GetCharABCWidthsW( hdc, first, last, abc );
|
|
||||||
if (ret)
|
if (ret)
|
||||||
{
|
{
|
||||||
for (i = first; i <= last; i++, abc++, abcf++)
|
/* convert device units to logical */
|
||||||
|
for (i = first; i <= last; i++, abcf++)
|
||||||
{
|
{
|
||||||
abcf->abcfA = abc->abcA;
|
abcf->abcfA = abcf->abcfA * dc->xformVport2World.eM11;
|
||||||
abcf->abcfB = abc->abcB;
|
abcf->abcfB = abcf->abcfB * dc->xformVport2World.eM11;
|
||||||
abcf->abcfC = abc->abcC;
|
abcf->abcfC = abcf->abcfC * dc->xformVport2World.eM11;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
HeapFree( GetProcessHeap(), 0, abc_base );
|
|
||||||
|
release_dc_ptr( dc );
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5912,6 +5912,38 @@ BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
* 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);
|
||||||
|
WineEngGetGlyphOutline(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;
|
||||||
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
* WineEngGetCharABCWidthsI
|
* WineEngGetCharABCWidthsI
|
||||||
*
|
*
|
||||||
|
@ -6605,6 +6637,12 @@ BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar, UINT lastChar,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT first, UINT last, LPABCFLOAT buffer)
|
||||||
|
{
|
||||||
|
ERR("called but we don't have FreeType\n");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD pgi,
|
BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar, UINT count, LPWORD pgi,
|
||||||
LPABC buffer)
|
LPABC buffer)
|
||||||
{
|
{
|
||||||
|
|
|
@ -412,6 +412,8 @@ extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN;
|
||||||
extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM) DECLSPEC_HIDDEN;
|
extern DWORD WineEngEnumFonts(LPLOGFONTW, FONTENUMPROCW, LPARAM) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar,
|
extern BOOL WineEngGetCharABCWidths(GdiFont *font, UINT firstChar,
|
||||||
UINT lastChar, LPABC buffer) DECLSPEC_HIDDEN;
|
UINT lastChar, LPABC buffer) DECLSPEC_HIDDEN;
|
||||||
|
extern BOOL WineEngGetCharABCWidthsFloat(GdiFont *font, UINT firstChar,
|
||||||
|
UINT lastChar, LPABCFLOAT buffer) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar,
|
extern BOOL WineEngGetCharABCWidthsI(GdiFont *font, UINT firstChar,
|
||||||
UINT count, LPWORD pgi, LPABC buffer) DECLSPEC_HIDDEN;
|
UINT count, LPWORD pgi, LPABC buffer) DECLSPEC_HIDDEN;
|
||||||
extern BOOL WineEngGetCharWidth(GdiFont*, UINT, UINT, LPINT) DECLSPEC_HIDDEN;
|
extern BOOL WineEngGetCharWidth(GdiFont*, UINT, UINT, LPINT) DECLSPEC_HIDDEN;
|
||||||
|
|
Loading…
Reference in New Issue