2 * Enhanced MetaFile driver graphics functions
4 * Copyright 1999 Huw D M Davies
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/port.h"
31 #include "enhmfdrv/enhmetafiledrv.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
36 /**********************************************************************
40 EMFDRV_MoveTo(PHYSDEV dev, INT x, INT y)
44 emr.emr.iType = EMR_MOVETOEX;
45 emr.emr.nSize = sizeof(emr);
49 return EMFDRV_WriteRecord( dev, &emr.emr );
52 /***********************************************************************
56 EMFDRV_LineTo( PHYSDEV dev, INT x, INT y )
62 emr.emr.iType = EMR_LINETO;
63 emr.emr.nSize = sizeof(emr);
67 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
70 GetCurrentPositionEx( dev->hdc, &pt );
72 bounds.left = min(x, pt.x);
73 bounds.top = min(y, pt.y);
74 bounds.right = max(x, pt.x);
75 bounds.bottom = max(y, pt.y);
77 EMFDRV_UpdateBBox( dev, &bounds );
83 /***********************************************************************
87 EMFDRV_ArcChordPie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
88 INT xstart, INT ystart, INT xend, INT yend, DWORD iType )
90 INT temp, xCentre, yCentre, i;
91 double angleStart, angleEnd;
92 double xinterStart, yinterStart, xinterEnd, yinterEnd;
96 if(left == right || top == bottom) return FALSE;
98 if(left > right) {temp = left; left = right; right = temp;}
99 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
101 if(GetGraphicsMode(dev->hdc) == GM_COMPATIBLE) {
106 emr.emr.iType = iType;
107 emr.emr.nSize = sizeof(emr);
108 emr.rclBox.left = left;
109 emr.rclBox.top = top;
110 emr.rclBox.right = right;
111 emr.rclBox.bottom = bottom;
112 emr.ptlStart.x = xstart;
113 emr.ptlStart.y = ystart;
118 /* Now calculate the BBox */
119 xCentre = (left + right + 1) / 2;
120 yCentre = (top + bottom + 1) / 2;
127 /* invert y co-ords to get angle anti-clockwise from x-axis */
128 angleStart = atan2( -(double)ystart, (double)xstart);
129 angleEnd = atan2( -(double)yend, (double)xend);
131 /* These are the intercepts of the start/end lines with the arc */
133 xinterStart = (right - left + 1)/2 * cos(angleStart) + xCentre;
134 yinterStart = -(bottom - top + 1)/2 * sin(angleStart) + yCentre;
135 xinterEnd = (right - left + 1)/2 * cos(angleEnd) + xCentre;
136 yinterEnd = -(bottom - top + 1)/2 * sin(angleEnd) + yCentre;
138 if(angleStart < 0) angleStart += 2 * M_PI;
139 if(angleEnd < 0) angleEnd += 2 * M_PI;
140 if(angleEnd < angleStart) angleEnd += 2 * M_PI;
142 bounds.left = min(xinterStart, xinterEnd);
143 bounds.top = min(yinterStart, yinterEnd);
144 bounds.right = max(xinterStart, xinterEnd);
145 bounds.bottom = max(yinterStart, yinterEnd);
147 for(i = 0; i <= 8; i++) {
148 if(i * M_PI / 2 < angleStart) /* loop until we're past start */
150 if(i * M_PI / 2 > angleEnd) /* if we're past end we're finished */
153 /* the arc touches the rectangle at the start of quadrant i, so adjust
154 BBox to reflect this. */
158 bounds.right = right;
167 bounds.bottom = bottom;
172 /* If we're drawing a pie then make sure we include the centre */
173 if(iType == EMR_PIE) {
174 if(bounds.left > xCentre) bounds.left = xCentre;
175 else if(bounds.right < xCentre) bounds.right = xCentre;
176 if(bounds.top > yCentre) bounds.top = yCentre;
177 else if(bounds.bottom < yCentre) bounds.right = yCentre;
179 if(!EMFDRV_WriteRecord( dev, &emr.emr ))
181 EMFDRV_UpdateBBox( dev, &bounds );
186 /***********************************************************************
190 EMFDRV_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
191 INT xstart, INT ystart, INT xend, INT yend )
193 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
194 xend, yend, EMR_ARC );
197 /***********************************************************************
201 EMFDRV_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
202 INT xstart, INT ystart, INT xend, INT yend )
204 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
205 xend, yend, EMR_PIE );
209 /***********************************************************************
213 EMFDRV_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
214 INT xstart, INT ystart, INT xend, INT yend )
216 return EMFDRV_ArcChordPie( dev, left, top, right, bottom, xstart, ystart,
217 xend, yend, EMR_CHORD );
220 /***********************************************************************
224 EMFDRV_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
229 TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
231 if(left == right || top == bottom) return FALSE;
233 if(left > right) {temp = left; left = right; right = temp;}
234 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
236 if(GetGraphicsMode( dev->hdc ) == GM_COMPATIBLE) {
241 emr.emr.iType = EMR_ELLIPSE;
242 emr.emr.nSize = sizeof(emr);
243 emr.rclBox.left = left;
244 emr.rclBox.top = top;
245 emr.rclBox.right = right;
246 emr.rclBox.bottom = bottom;
248 EMFDRV_UpdateBBox( dev, &emr.rclBox );
249 return EMFDRV_WriteRecord( dev, &emr.emr );
252 /***********************************************************************
256 EMFDRV_Rectangle(PHYSDEV dev, INT left, INT top, INT right, INT bottom)
261 TRACE("%d,%d - %d,%d\n", left, top, right, bottom);
263 if(left == right || top == bottom) return FALSE;
265 if(left > right) {temp = left; left = right; right = temp;}
266 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
268 if(GetGraphicsMode( dev->hdc ) == GM_COMPATIBLE) {
273 emr.emr.iType = EMR_RECTANGLE;
274 emr.emr.nSize = sizeof(emr);
275 emr.rclBox.left = left;
276 emr.rclBox.top = top;
277 emr.rclBox.right = right;
278 emr.rclBox.bottom = bottom;
280 EMFDRV_UpdateBBox( dev, &emr.rclBox );
281 return EMFDRV_WriteRecord( dev, &emr.emr );
284 /***********************************************************************
288 EMFDRV_RoundRect( PHYSDEV dev, INT left, INT top, INT right,
289 INT bottom, INT ell_width, INT ell_height )
294 if(left == right || top == bottom) return FALSE;
296 if(left > right) {temp = left; left = right; right = temp;}
297 if(top > bottom) {temp = top; top = bottom; bottom = temp;}
299 if(GetGraphicsMode( dev->hdc ) == GM_COMPATIBLE) {
304 emr.emr.iType = EMR_ROUNDRECT;
305 emr.emr.nSize = sizeof(emr);
306 emr.rclBox.left = left;
307 emr.rclBox.top = top;
308 emr.rclBox.right = right;
309 emr.rclBox.bottom = bottom;
310 emr.szlCorner.cx = ell_width;
311 emr.szlCorner.cy = ell_height;
313 EMFDRV_UpdateBBox( dev, &emr.rclBox );
314 return EMFDRV_WriteRecord( dev, &emr.emr );
317 /***********************************************************************
321 EMFDRV_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
325 emr.emr.iType = EMR_SETPIXELV;
326 emr.emr.nSize = sizeof(emr);
331 if (EMFDRV_WriteRecord( dev, &emr.emr )) {
333 bounds.left = bounds.right = x;
334 bounds.top = bounds.bottom = y;
335 EMFDRV_UpdateBBox( dev, &bounds );
341 /**********************************************************************
344 * Helper for EMFDRV_Poly{line|gon}
347 EMFDRV_Polylinegon( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
354 size = sizeof(EMRPOLYLINE) + sizeof(POINTL) * (count - 1);
356 emr = HeapAlloc( GetProcessHeap(), 0, size );
357 emr->emr.iType = iType;
358 emr->emr.nSize = size;
360 emr->rclBounds.left = emr->rclBounds.right = pt[0].x;
361 emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y;
363 for(i = 1; i < count; i++) {
364 if(pt[i].x < emr->rclBounds.left)
365 emr->rclBounds.left = pt[i].x;
366 else if(pt[i].x > emr->rclBounds.right)
367 emr->rclBounds.right = pt[i].x;
368 if(pt[i].y < emr->rclBounds.top)
369 emr->rclBounds.top = pt[i].y;
370 else if(pt[i].y > emr->rclBounds.bottom)
371 emr->rclBounds.bottom = pt[i].y;
375 memcpy(emr->aptl, pt, count * sizeof(POINTL));
377 ret = EMFDRV_WriteRecord( dev, &emr->emr );
379 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
380 HeapFree( GetProcessHeap(), 0, emr );
385 /**********************************************************************
386 * EMFDRV_Polylinegon16
388 * Helper for EMFDRV_Poly{line|gon}
390 * This is not a legacy function!
391 * We are using SHORT integers to save space.
394 EMFDRV_Polylinegon16( PHYSDEV dev, const POINT* pt, INT count, DWORD iType )
401 /* check whether all points fit in the SHORT int POINT structure */
402 for(i = 0; i < count; i++) {
403 if( ((pt[i].x+0x8000) & ~0xffff ) ||
404 ((pt[i].y+0x8000) & ~0xffff ) )
408 size = sizeof(EMRPOLYLINE16) + sizeof(POINTS) * (count - 1);
410 emr = HeapAlloc( GetProcessHeap(), 0, size );
411 emr->emr.iType = iType;
412 emr->emr.nSize = size;
414 emr->rclBounds.left = emr->rclBounds.right = pt[0].x;
415 emr->rclBounds.top = emr->rclBounds.bottom = pt[0].y;
417 for(i = 1; i < count; i++) {
418 if(pt[i].x < emr->rclBounds.left)
419 emr->rclBounds.left = pt[i].x;
420 else if(pt[i].x > emr->rclBounds.right)
421 emr->rclBounds.right = pt[i].x;
422 if(pt[i].y < emr->rclBounds.top)
423 emr->rclBounds.top = pt[i].y;
424 else if(pt[i].y > emr->rclBounds.bottom)
425 emr->rclBounds.bottom = pt[i].y;
429 for(i = 0; i < count; i++ ) {
430 emr->apts[i].x = pt[i].x;
431 emr->apts[i].y = pt[i].y;
434 ret = EMFDRV_WriteRecord( dev, &emr->emr );
436 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
437 HeapFree( GetProcessHeap(), 0, emr );
442 /**********************************************************************
446 EMFDRV_Polyline( PHYSDEV dev, const POINT* pt, INT count )
448 if( EMFDRV_Polylinegon16( dev, pt, count, EMR_POLYLINE16 ) )
450 return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYLINE );
453 /**********************************************************************
457 EMFDRV_Polygon( PHYSDEV dev, const POINT* pt, INT count )
459 if(count < 2) return FALSE;
460 if( EMFDRV_Polylinegon16( dev, pt, count, EMR_POLYGON16 ) )
462 return EMFDRV_Polylinegon( dev, pt, count, EMR_POLYGON );
466 /**********************************************************************
467 * EMFDRV_PolyPolylinegon
469 * Helper for EMFDRV_PolyPoly{line|gon}
472 EMFDRV_PolyPolylinegon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys,
475 EMRPOLYPOLYLINE *emr;
476 DWORD cptl = 0, poly, size;
482 bounds.left = bounds.right = pt[0].x;
483 bounds.top = bounds.bottom = pt[0].y;
486 for(poly = 0; poly < polys; poly++) {
487 cptl += counts[poly];
488 for(point = 0; point < counts[poly]; point++) {
489 if(bounds.left > pts->x) bounds.left = pts->x;
490 else if(bounds.right < pts->x) bounds.right = pts->x;
491 if(bounds.top > pts->y) bounds.top = pts->y;
492 else if(bounds.bottom < pts->y) bounds.bottom = pts->y;
497 size = sizeof(EMRPOLYPOLYLINE) + (polys - 1) * sizeof(DWORD) +
498 (cptl - 1) * sizeof(POINTL);
500 emr = HeapAlloc( GetProcessHeap(), 0, size );
502 emr->emr.iType = iType;
503 emr->emr.nSize = size;
504 emr->rclBounds = bounds;
507 memcpy(emr->aPolyCounts, counts, polys * sizeof(DWORD));
508 memcpy(emr->aPolyCounts + polys, pt, cptl * sizeof(POINTL));
509 ret = EMFDRV_WriteRecord( dev, &emr->emr );
511 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
512 HeapFree( GetProcessHeap(), 0, emr );
516 /**********************************************************************
517 * EMFDRV_PolyPolyline
520 EMFDRV_PolyPolyline(PHYSDEV dev, const POINT* pt, const DWORD* counts, DWORD polys)
522 return EMFDRV_PolyPolylinegon( dev, pt, (const INT *)counts, polys,
526 /**********************************************************************
530 EMFDRV_PolyPolygon( PHYSDEV dev, const POINT* pt, const INT* counts, UINT polys )
532 return EMFDRV_PolyPolylinegon( dev, pt, counts, polys, EMR_POLYPOLYGON );
536 /**********************************************************************
537 * EMFDRV_ExtFloodFill
540 EMFDRV_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT fillType )
544 emr.emr.iType = EMR_EXTFLOODFILL;
545 emr.emr.nSize = sizeof(emr);
549 emr.iMode = fillType;
551 return EMFDRV_WriteRecord( dev, &emr.emr );
555 /*********************************************************************
558 BOOL CDECL EMFDRV_FillRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush )
561 DWORD size, rgnsize, index;
564 index = EMFDRV_CreateBrushIndirect( dev, hbrush );
565 if(!index) return FALSE;
567 rgnsize = GetRegionData( hrgn, 0, NULL );
568 size = rgnsize + offsetof(EMRFILLRGN,RgnData);
569 emr = HeapAlloc( GetProcessHeap(), 0, size );
571 GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
573 emr->emr.iType = EMR_FILLRGN;
574 emr->emr.nSize = size;
575 emr->rclBounds.left = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.left;
576 emr->rclBounds.top = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.top;
577 emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1;
578 emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
579 emr->cbRgnData = rgnsize;
580 emr->ihBrush = index;
582 ret = EMFDRV_WriteRecord( dev, &emr->emr );
584 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
585 HeapFree( GetProcessHeap(), 0, emr );
588 /*********************************************************************
591 BOOL CDECL EMFDRV_FrameRgn( PHYSDEV dev, HRGN hrgn, HBRUSH hbrush, INT width, INT height )
594 DWORD size, rgnsize, index;
597 index = EMFDRV_CreateBrushIndirect( dev, hbrush );
598 if(!index) return FALSE;
600 rgnsize = GetRegionData( hrgn, 0, NULL );
601 size = rgnsize + offsetof(EMRFRAMERGN,RgnData);
602 emr = HeapAlloc( GetProcessHeap(), 0, size );
604 GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
606 emr->emr.iType = EMR_FRAMERGN;
607 emr->emr.nSize = size;
608 emr->rclBounds.left = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.left;
609 emr->rclBounds.top = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.top;
610 emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1;
611 emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
612 emr->cbRgnData = rgnsize;
613 emr->ihBrush = index;
614 emr->szlStroke.cx = width;
615 emr->szlStroke.cy = height;
617 ret = EMFDRV_WriteRecord( dev, &emr->emr );
619 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
620 HeapFree( GetProcessHeap(), 0, emr );
624 /*********************************************************************
625 * EMFDRV_PaintInvertRgn
627 * Helper for EMFDRV_{Paint|Invert}Rgn
629 static BOOL EMFDRV_PaintInvertRgn( PHYSDEV dev, HRGN hrgn, DWORD iType )
636 rgnsize = GetRegionData( hrgn, 0, NULL );
637 size = rgnsize + offsetof(EMRINVERTRGN,RgnData);
638 emr = HeapAlloc( GetProcessHeap(), 0, size );
640 GetRegionData( hrgn, rgnsize, (RGNDATA *)&emr->RgnData );
642 emr->emr.iType = iType;
643 emr->emr.nSize = size;
644 emr->rclBounds.left = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.left;
645 emr->rclBounds.top = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.top;
646 emr->rclBounds.right = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.right - 1;
647 emr->rclBounds.bottom = ((RGNDATA *)&emr->RgnData)->rdh.rcBound.bottom - 1;
648 emr->cbRgnData = rgnsize;
650 ret = EMFDRV_WriteRecord( dev, &emr->emr );
652 EMFDRV_UpdateBBox( dev, &emr->rclBounds );
653 HeapFree( GetProcessHeap(), 0, emr );
657 /**********************************************************************
661 EMFDRV_PaintRgn( PHYSDEV dev, HRGN hrgn )
663 return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_PAINTRGN );
666 /**********************************************************************
670 EMFDRV_InvertRgn( PHYSDEV dev, HRGN hrgn )
672 return EMFDRV_PaintInvertRgn( dev, hrgn, EMR_INVERTRGN );
675 /**********************************************************************
678 BOOL CDECL EMFDRV_ExtTextOut( PHYSDEV dev, INT x, INT y, UINT flags,
679 const RECT *lprect, LPCWSTR str, UINT count,
682 EMREXTTEXTOUTW *pemr;
687 const UINT textAlign = GetTextAlign( dev->hdc );
688 const INT graphicsMode = GetGraphicsMode( dev->hdc );
689 FLOAT exScale, eyScale;
691 nSize = sizeof(*pemr) + ((count+1) & ~1) * sizeof(WCHAR) + count * sizeof(INT);
693 TRACE("%s %s count %d nSize = %d\n", debugstr_wn(str, count),
694 wine_dbgstr_rect(lprect), count, nSize);
695 pemr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nSize);
697 if (graphicsMode == GM_COMPATIBLE)
699 const INT horzSize = GetDeviceCaps( dev->hdc, HORZSIZE );
700 const INT horzRes = GetDeviceCaps( dev->hdc, HORZRES );
701 const INT vertSize = GetDeviceCaps( dev->hdc, VERTSIZE );
702 const INT vertRes = GetDeviceCaps( dev->hdc, VERTRES );
703 SIZE wndext, vportext;
705 GetViewportExtEx( dev->hdc, &vportext );
706 GetWindowExtEx( dev->hdc, &wndext );
707 exScale = 100.0 * ((FLOAT)horzSize / (FLOAT)horzRes) /
708 ((FLOAT)wndext.cx / (FLOAT)vportext.cx);
709 eyScale = 100.0 * ((FLOAT)vertSize / (FLOAT)vertRes) /
710 ((FLOAT)wndext.cy / (FLOAT)vportext.cy);
718 pemr->emr.iType = EMR_EXTTEXTOUTW;
719 pemr->emr.nSize = nSize;
720 pemr->iGraphicsMode = graphicsMode;
721 pemr->exScale = exScale;
722 pemr->eyScale = eyScale;
723 pemr->emrtext.ptlReference.x = x;
724 pemr->emrtext.ptlReference.y = y;
725 pemr->emrtext.nChars = count;
726 pemr->emrtext.offString = sizeof(*pemr);
727 memcpy((char*)pemr + pemr->emrtext.offString, str, count * sizeof(WCHAR));
728 pemr->emrtext.fOptions = flags;
730 pemr->emrtext.rcl.left = pemr->emrtext.rcl.top = 0;
731 pemr->emrtext.rcl.right = pemr->emrtext.rcl.bottom = -1;
733 pemr->emrtext.rcl.left = lprect->left;
734 pemr->emrtext.rcl.top = lprect->top;
735 pemr->emrtext.rcl.right = lprect->right;
736 pemr->emrtext.rcl.bottom = lprect->bottom;
739 pemr->emrtext.offDx = pemr->emrtext.offString + ((count+1) & ~1) * sizeof(WCHAR);
743 memcpy((char*)pemr + pemr->emrtext.offDx, lpDx, count * sizeof(INT));
744 for (i = 0; i < count; i++) {
745 textWidth += lpDx[i];
747 if (GetTextExtentPoint32W( dev->hdc, str, count, &strSize ))
748 textHeight = strSize.cy;
752 INT *dx = (INT *)((char*)pemr + pemr->emrtext.offDx);
754 for (i = 0; i < count; i++) {
755 if (GetTextExtentPoint32W( dev->hdc, str + i, 1, &charSize )) {
757 textWidth += charSize.cx;
758 textHeight = max(textHeight, charSize.cy);
765 pemr->rclBounds.left = pemr->rclBounds.top = 0;
766 pemr->rclBounds.right = pemr->rclBounds.bottom = -1;
770 switch (textAlign & (TA_LEFT | TA_RIGHT | TA_CENTER)) {
772 pemr->rclBounds.left = x - (textWidth / 2) - 1;
773 pemr->rclBounds.right = x + (textWidth / 2) + 1;
777 pemr->rclBounds.left = x - textWidth - 1;
778 pemr->rclBounds.right = x;
781 default: { /* TA_LEFT */
782 pemr->rclBounds.left = x;
783 pemr->rclBounds.right = x + textWidth + 1;
787 switch (textAlign & (TA_TOP | TA_BOTTOM | TA_BASELINE)) {
790 if (!GetTextMetricsW( dev->hdc, &tm ))
792 /* Play safe here... it's better to have a bounding box */
793 /* that is too big than too small. */
794 pemr->rclBounds.top = y - textHeight - 1;
795 pemr->rclBounds.bottom = y + tm.tmDescent + 1;
799 pemr->rclBounds.top = y - textHeight - 1;
800 pemr->rclBounds.bottom = y;
803 default: { /* TA_TOP */
804 pemr->rclBounds.top = y;
805 pemr->rclBounds.bottom = y + textHeight + 1;
808 EMFDRV_UpdateBBox( dev, &pemr->rclBounds );
811 ret = EMFDRV_WriteRecord( dev, &pemr->emr );
812 HeapFree( GetProcessHeap(), 0, pemr );