# HG changeset patch # User mhessling@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1054097554 0 # Node ID 98d6c00fe11e6c3f0d6739b4bafca0e23b04073b # Parent 0b52875e1588b44077d4640f79636dc9e2170d81 Fix bug with specifying fonts with modifiers; the modifiers were not being stripped. Still may not be sufficient; see comment in code. Drawing filled and hollow rectangles now work the same as under GTK. diff -r 0b52875e1588 -r 98d6c00fe11e win/dw.c --- a/win/dw.c Tue May 27 22:34:14 2003 +0000 +++ b/win/dw.c Wed May 28 04:52:34 2003 +0000 @@ -3406,6 +3406,7 @@ HFONT hfont; int z, size = 9; LOGFONT lf; + char *myFontName; if(fontname == DefaultFont || !fontname[0]) hfont = GetStockObject(DEFAULT_GUI_FONT); @@ -3437,7 +3438,19 @@ lf.lfClipPrecision = 0; lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH | FW_DONTCARE; - strcpy(lf.lfFaceName, &fontname[z+1]); + /* + * remove any font modifiers by truncating at the first space + * - this may not be enough!; what about "Courier New" ??? + */ + myFontName = strdup(&fontname[z+1]); + for(z=0;z= THREAD_LIMIT) @@ -6901,11 +6915,11 @@ else return; - oldPen = SelectObject(hdcPaint, _hPen[threadid]); - oldBrush = SelectObject(hdcPaint, _hBrush[threadid]); - Rectangle(hdcPaint, x, y, x + width, y + height); - SelectObject(hdcPaint, oldPen); - SelectObject(hdcPaint, oldBrush); + SetRect(&Rect, x, y, x + width , y + height ); + if(fill) + FillRect(hdcPaint, &Rect, _hBrush[threadid]); + else + FrameRect(hdcPaint, &Rect, _hBrush[threadid]); if(!pixmap) ReleaseDC(handle, hdcPaint); }