Alexandre Julliard : gdi32: Remove special handling for linked fonts in ExtTextOut.
Alexandre Julliard
julliard at winehq.org
Wed Dec 5 13:43:10 CST 2012
Module: wine
Branch: master
Commit: 6144824965ec6e6a323979f18df7b15feaf3f0a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=6144824965ec6e6a323979f18df7b15feaf3f0a4
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Dec 5 16:44:15 2012 +0100
gdi32: Remove special handling for linked fonts in ExtTextOut.
---
dlls/gdi32/font.c | 75 +--------------------------------------------
dlls/gdi32/freetype.c | 26 ----------------
dlls/gdi32/gdi_private.h | 1 -
3 files changed, 2 insertions(+), 100 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 8580fcb..f84e707 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -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 );
- }
+ ret = physdev->funcs->pExtTextOut( physdev, x, y, (flags & ~ETO_OPAQUE), &rc,
+ glyphs ? glyphs : reordered_str, count, (INT*)deltas );
done:
HeapFree(GetProcessHeap(), 0, deltas);
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index c5543e1..f9db1d7 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -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.@)
*/
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index e3fe577..2408c97 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -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;
More information about the wine-cvs
mailing list