# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1054201984 0 # Node ID 7f39be80dec3e01e23af7d453d46c7d33e91d627 # Parent fac2afe7bda31340368dae75a548d943964317bd Hopefully better method of removing the font modifiers. diff -r fac2afe7bda3 -r 7f39be80dec3 win/dw.c --- a/win/dw.c Thu May 29 09:18:54 2003 +0000 +++ b/win/dw.c Thu May 29 09:53:04 2003 +0000 @@ -3384,7 +3384,7 @@ for(z=0;z<=(buflen-len);z++) { if(memcmp(text, &buffer[z], len) == 0) - return 1; + return z; } } return 0; @@ -3404,14 +3404,15 @@ HFONT _acquire_font(HWND handle, char *fontname) { HFONT hfont; - int z, size = 9; - LOGFONT lf; - char *myFontName; if(fontname == DefaultFont || !fontname[0]) hfont = GetStockObject(DEFAULT_GUI_FONT); else { + int Italic, Bold; + char *myFontName; + int z, size = 9; + LOGFONT lf; #if 0 HDC hDC = GetDC(handle); #endif @@ -3421,7 +3422,8 @@ break; } size = atoi(fontname) + 5; - + Italic = instring(" Italic", &fontname[z+1]); + Bold = instring(" Bold", &fontname[z+1]); #if 0 lf.lfHeight = -MulDiv(size, GetDeviceCaps(hDC, LOGPIXELSY), 72); #endif @@ -3429,26 +3431,23 @@ lf.lfWidth = 0; lf.lfEscapement = 0; lf.lfOrientation = 0; - lf.lfItalic = instring(" Italic", &fontname[z+1]); + lf.lfItalic = Italic ? TRUE : FALSE; lf.lfUnderline = 0; lf.lfStrikeOut = 0; - lf.lfWeight = instring(" Bold", &fontname[z+1]) ? FW_BOLD : FW_NORMAL; + lf.lfWeight = Bold ? FW_BOLD : FW_NORMAL; lf.lfCharSet = DEFAULT_CHARSET; lf.lfOutPrecision = 0; lf.lfClipPrecision = 0; lf.lfQuality = DEFAULT_QUALITY; lf.lfPitchAndFamily = DEFAULT_PITCH | FW_DONTCARE; /* - * remove any font modifiers by truncating at the first space - * - this may not be enough!; what about "Courier New" ??? + * remove any font modifiers */ myFontName = strdup(&fontname[z+1]); - for(z=0;z