gdi32: Remove special handling for linked fonts in ExtTextOut.
This commit is contained in:
parent
5535302758
commit
6144824965
|
@ -2371,79 +2371,8 @@ BOOL WINAPI ExtTextOutW( HDC hdc, INT x, INT y, UINT flags,
|
|||
}
|
||||
}
|
||||
|
||||
if(FontIsLinked(hdc) && !(flags & ETO_GLYPH_INDEX))
|
||||
{
|
||||
HFONT orig_font = dc->hFont, cur_font;
|
||||
UINT glyph;
|
||||
INT span = 0;
|
||||
POINT *offsets = NULL;
|
||||
unsigned int i;
|
||||
|
||||
glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WORD));
|
||||
for(i = 0; i < count; i++)
|
||||
{
|
||||
WineEngGetLinkedHFont(dc, reordered_str[i], &cur_font, &glyph);
|
||||
if(cur_font != dc->hFont)
|
||||
{
|
||||
if(!offsets)
|
||||
{
|
||||
unsigned int j;
|
||||
offsets = HeapAlloc(GetProcessHeap(), 0, count * sizeof(*deltas));
|
||||
offsets[0].x = offsets[0].y = 0;
|
||||
|
||||
if(!deltas)
|
||||
{
|
||||
SIZE tmpsz;
|
||||
for(j = 1; j < count; j++)
|
||||
{
|
||||
GetTextExtentPointW(hdc, reordered_str + j - 1, 1, &tmpsz);
|
||||
offsets[j].x = offsets[j - 1].x + abs(INTERNAL_XWSTODS(dc, tmpsz.cx));
|
||||
offsets[j].y = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(j = 1; j < count; j++)
|
||||
{
|
||||
offsets[j].x = offsets[j - 1].x + deltas[j].x;
|
||||
offsets[j].y = offsets[j - 1].y + deltas[j].y;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(span)
|
||||
{
|
||||
physdev->funcs->pExtTextOut( physdev, x + offsets[i - span].x,
|
||||
y + offsets[i - span].y,
|
||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
||||
span, deltas ? (INT*)(deltas + (i - span)) : NULL);
|
||||
span = 0;
|
||||
}
|
||||
SelectObject(hdc, cur_font);
|
||||
}
|
||||
glyphs[span++] = glyph;
|
||||
|
||||
if(i == count - 1)
|
||||
{
|
||||
ret = physdev->funcs->pExtTextOut(physdev, x + (offsets ? offsets[count - span].x : 0),
|
||||
y + (offsets ? offsets[count - span].y : 0),
|
||||
(flags & ~ETO_OPAQUE) | ETO_GLYPH_INDEX, &rc, glyphs,
|
||||
span, deltas ? (INT*)(deltas + (count - span)) : NULL);
|
||||
SelectObject(hdc, orig_font);
|
||||
HeapFree(GetProcessHeap(), 0, offsets);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!(flags & ETO_GLYPH_INDEX) && dc->gdiFont)
|
||||
{
|
||||
glyphs = HeapAlloc(GetProcessHeap(), 0, count * sizeof(WORD));
|
||||
GetGlyphIndicesW(hdc, reordered_str, count, glyphs, 0);
|
||||
flags |= ETO_GLYPH_INDEX;
|
||||
}
|
||||
ret = physdev->funcs->pExtTextOut( physdev, x, y, (flags & ~ETO_OPAQUE), &rc,
|
||||
glyphs ? glyphs : reordered_str, count, (INT*)deltas );
|
||||
}
|
||||
|
||||
done:
|
||||
HeapFree(GetProcessHeap(), 0, deltas);
|
||||
|
|
|
@ -7431,27 +7431,6 @@ static UINT freetype_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD
|
|||
return physdev->font->charset;
|
||||
}
|
||||
|
||||
BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
|
||||
{
|
||||
GdiFont *font = dc->gdiFont, *linked_font;
|
||||
struct list *first_hfont;
|
||||
BOOL ret;
|
||||
|
||||
GDI_CheckNotLock();
|
||||
EnterCriticalSection( &freetype_cs );
|
||||
ret = get_glyph_index_linked(font, c, &linked_font, glyph);
|
||||
TRACE("get_glyph_index_linked glyph %d font %p\n", *glyph, linked_font);
|
||||
if(font == linked_font)
|
||||
*new_hfont = dc->hFont;
|
||||
else
|
||||
{
|
||||
first_hfont = list_head(&linked_font->hfontlist);
|
||||
*new_hfont = LIST_ENTRY(first_hfont, struct tagHFONTLIST, entry)->hfont;
|
||||
}
|
||||
LeaveCriticalSection( &freetype_cs );
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Retrieve a list of supported Unicode ranges for a given font.
|
||||
* Can be called with NULL gs to calculate the buffer size. Returns
|
||||
* the number of ranges found.
|
||||
|
@ -8020,11 +7999,6 @@ BOOL WineEngCreateScalableFontResource( DWORD hidden, LPCWSTR resource,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* GetRasterizerCaps (GDI32.@)
|
||||
*/
|
||||
|
|
|
@ -294,7 +294,6 @@ extern INT WineEngAddFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN;
|
|||
extern HANDLE WineEngAddFontMemResourceEx(PVOID, DWORD, PVOID, LPDWORD) DECLSPEC_HIDDEN;
|
||||
extern BOOL WineEngCreateScalableFontResource(DWORD, LPCWSTR, LPCWSTR, LPCWSTR) DECLSPEC_HIDDEN;
|
||||
extern BOOL WineEngDestroyFontInstance(HFONT handle) DECLSPEC_HIDDEN;
|
||||
extern BOOL WineEngGetLinkedHFont(DC *dc, WCHAR c, HFONT *new_hfont, UINT *glyph) DECLSPEC_HIDDEN;
|
||||
extern BOOL WineEngInit(void) DECLSPEC_HIDDEN;
|
||||
extern BOOL WineEngRemoveFontResourceEx(LPCWSTR, DWORD, PVOID) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
Loading…
Reference in New Issue