Changeset 10372 for trunk/src/gdi32/font.cpp
- Timestamp:
- Jan 8, 2004, 12:11:55 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/font.cpp
r10350 r10372 1 /* $Id: font.cpp,v 1.3 3 2003-12-01 13:28:10sandervl Exp $ */1 /* $Id: font.cpp,v 1.34 2004-01-08 11:11:55 sandervl Exp $ */ 2 2 3 3 /* … … 167 167 int charset = GetTextCharset(hdc); 168 168 169 if( IsDBCSEnv() && ( charset == 0 )) 170 cp = CP_ACP; 171 else 169 172 /* Hmm, nicely designed api this one! */ 170 173 if(TranslateCharsetInfo((DWORD*)charset, &csi, TCI_SRCCHARSET)) … … 172 175 else { 173 176 switch(charset) { 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 177 case OEM_CHARSET: 178 cp = GetOEMCP(); 179 break; 180 case DEFAULT_CHARSET: 181 cp = GetACP(); 182 break; 183 184 case VISCII_CHARSET: 185 case TCVN_CHARSET: 186 case KOI8_CHARSET: 187 case ISO3_CHARSET: 188 case ISO4_CHARSET: 189 /* FIXME: These have no place here, but because x11drv 190 enumerates fonts with these (made up) charsets some apps 191 might use them and then the FIXME below would become 192 annoying. Now we could pick the intended codepage for 193 each of these, but since it's broken anyway we'll just 194 use CP_ACP and hope it'll go away... 195 */ 196 cp = CP_ACP; 197 break; 198 199 200 default: 201 dprintf(("Can't find codepage for charset %d\n", charset)); 202 break; 203 } 201 204 } 202 205 … … 206 209 if(cp != CP_SYMBOL) { 207 210 lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0); 208 209 211 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 212 MultiByteToWideChar(cp, 0, str, count, strW, lenW); 210 213 } else { 211 214 lenW = count; 212 213 215 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 216 for(i = 0; i < count; i++) strW[i] = (BYTE)str[i]; 214 217 } 215 218 strW[lenW] = '\0';
Note:
See TracChangeset
for help on using the changeset viewer.