Module: wine Branch: master Commit: d99754adc15f60ea1f7f9bf6b70788d028876bd7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=d99754adc15f60ea1f7f9bf6b7...
Author: Huw Davies huw@codeweavers.com Date: Thu Apr 22 09:29:30 2010 +0100
wineps.drv: Make the rectangle an optional parameter to get_bbox().
---
dlls/wineps.drv/download.c | 19 +++++++++++-------- 1 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/wineps.drv/download.c b/dlls/wineps.drv/download.c index 82b70b4..bf9cb09 100644 --- a/dlls/wineps.drv/download.c +++ b/dlls/wineps.drv/download.c @@ -168,20 +168,23 @@ static BOOL is_room_for_font(PSDRV_PDEVICE *physDev) * the font size we'll get the data directly from the TrueType HEAD table rather * than using GetOutlineTextMetrics. */ -static BOOL get_bbox(PSDRV_PDEVICE *physDev, RECT *rc, UINT *emsize) +static BOOL get_bbox(HDC hdc, RECT *rc, UINT *emsize) { BYTE head[54]; /* the head table is 54 bytes long */
- if(GetFontData(physDev->hdc, MS_MAKE_TAG('h','e','a','d'), 0, head, - sizeof(head)) == GDI_ERROR) { + if(GetFontData(hdc, MS_MAKE_TAG('h','e','a','d'), 0, head, sizeof(head)) == GDI_ERROR) + { ERR("Can't retrieve head table\n"); return FALSE; } *emsize = GET_BE_WORD(head + 18); /* unitsPerEm */ - rc->left = (signed short)GET_BE_WORD(head + 36); /* xMin */ - rc->bottom = (signed short)GET_BE_WORD(head + 38); /* yMin */ - rc->right = (signed short)GET_BE_WORD(head + 40); /* xMax */ - rc->top = (signed short)GET_BE_WORD(head + 42); /* yMax */ + if(rc) + { + rc->left = (signed short)GET_BE_WORD(head + 36); /* xMin */ + rc->bottom = (signed short)GET_BE_WORD(head + 38); /* yMin */ + rc->right = (signed short)GET_BE_WORD(head + 40); /* xMax */ + rc->top = (signed short)GET_BE_WORD(head + 42); /* yMax */ + } return TRUE; }
@@ -243,7 +246,7 @@ BOOL PSDRV_WriteSetDownloadFont(PSDRV_PDEVICE *physDev) RECT bbox; UINT emsize;
- if (!get_bbox(physDev, &bbox, &emsize)) { + if (!get_bbox(physDev->hdc, &bbox, &emsize)) { HeapFree(GetProcessHeap(), 0, potm); return FALSE; }