# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1052805061 0 # Node ID a3a299455c6702c8248dba5b96c0177b7fc3b776 # Parent 47273b6a850007c2bb5c585feda82223be5a99fd Added parsing for " Bold" and " Italic" in the font name so it behaves like OS/2. diff -r 47273b6a8500 -r a3a299455c67 win/dw.c --- a/win/dw.c Tue May 13 05:32:22 2003 +0000 +++ b/win/dw.c Tue May 13 05:51:01 2003 +0000 @@ -3344,6 +3344,21 @@ } } +int instring(char *text, char *buffer) +{ + int z, len = strlen(text), buflen = strlen(buffer); + + if(buflen > len) + { + for(z=0;z<(buflen-len);z++) + { + if(memcmp(text, &buffer[z], len) == 0) + return 1; + } + } + return 0; +} + /* * Changes a window's parent to newparent. * Parameters: @@ -3382,10 +3397,10 @@ lf.lfWidth = 0; lf.lfEscapement = 0; lf.lfOrientation = 0; - lf.lfItalic = 0; + lf.lfItalic = instring(" Italic", &fontname[z+1]); lf.lfUnderline = 0; lf.lfStrikeOut = 0; - lf.lfWeight = FW_NORMAL; + lf.lfWeight = instring(" Bold", &fontname[z+1]) ? FW_BOLD : FW_NORMAL; lf.lfCharSet = DEFAULT_CHARSET; lf.lfOutPrecision = 0; lf.lfClipPrecision = 0;