Mercurial > dwindows
comparison win/dw.c @ 2261:281e2df2c022
Win: Fix logic error; only insert NULLs after searching the font string.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 27 Jan 2021 09:35:38 +0000 |
parents | 66d0f1df4b34 |
children | 3361ce6070ce |
comparison
equal
deleted
inserted
replaced
2260:cb24daa675a2 | 2261:281e2df2c022 |
---|---|
5698 if(myFontName) | 5698 if(myFontName) |
5699 myFontName = _strdup(++myFontName); | 5699 myFontName = _strdup(++myFontName); |
5700 else /* Otherwise use the whole fontname and default size of 9 */ | 5700 else /* Otherwise use the whole fontname and default size of 9 */ |
5701 myFontName = _strdup(fontname); | 5701 myFontName = _strdup(fontname); |
5702 | 5702 |
5703 if((Italic = strstr(myFontName, " Italic"))) | 5703 Italic = strstr(myFontName, " Italic"); |
5704 *Italic = 0; | 5704 Bold = strstr(myFontName, " Bold"); |
5705 if((Bold = strstr(myFontName, " Bold"))) | 5705 if(Italic) |
5706 *Bold = 0; | 5706 *Italic = 0; |
5707 if(Bold) | |
5708 *Bold = 0; | |
5707 | 5709 |
5708 cf.cbSize = sizeof(cf); | 5710 cf.cbSize = sizeof(cf); |
5709 SendMessage(handle, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf); | 5711 SendMessage(handle, EM_GETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf); |
5710 cf.dwMask = CFM_FACE | CFM_SIZE | CFM_ITALIC | CFM_BOLD; | 5712 cf.dwMask = CFM_FACE | CFM_SIZE | CFM_ITALIC | CFM_BOLD; |
5711 cf.dwEffects = (Italic ? CFE_ITALIC : 0) | (Bold ? CFE_BOLD : 0); | 5713 cf.dwEffects = (Italic ? CFE_ITALIC : 0) | (Bold ? CFE_BOLD : 0); |