Mercurial > dwindows
changeset 411:a3a299455c67
Added parsing for " Bold" and " Italic" in the font name so it behaves
like OS/2.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Tue, 13 May 2003 05:51:01 +0000 |
parents | 47273b6a8500 |
children | a8015e02b590 |
files | win/dw.c |
diffstat | 1 files changed, 17 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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;