Changeset 10605 for trunk/src/gdi32
- Timestamp:
- May 24, 2004, 10:51:25 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/src/gdi32/font.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/font.cpp
r10373 r10605 1 /* $Id: font.cpp,v 1.3 5 2004-01-11 11:42:11 sandervl Exp $ */1 /* $Id: font.cpp,v 1.36 2004-05-24 08:50:31 sandervl Exp $ */ 2 2 3 3 /* … … 319 319 strcpy( afont.lfFaceName, "WarpSans Combined" ); 320 320 } 321 322 #if 1 323 if( afont.lfCharSet == ANSI_CHARSET ) 324 afont.lfCharSet = DEFAULT_CHARSET; 325 #endif 321 326 } 322 327 … … 901 906 else { 902 907 switch(charset) { 903 case OEM_CHARSET:904 cp = GetOEMCP();905 break;906 case DEFAULT_CHARSET:907 cp = GetACP();908 break;909 910 case VISCII_CHARSET:911 case TCVN_CHARSET:912 case KOI8_CHARSET:913 case ISO3_CHARSET:914 case ISO4_CHARSET:915 /* FIXME: These have no place here, but because x11drv916 enumerates fonts with these (made up) charsets some apps917 might use them and then the FIXME below would become918 annoying. Now we could pick the intended codepage for919 each of these, but since it's broken anyway we'll just920 use CP_ACP and hope it'll go away...921 */922 cp = CP_ACP;923 break;924 925 926 default:927 dprintf(("Can't find codepage for charset %d\n", charset));928 break;929 }908 case OEM_CHARSET: 909 cp = GetOEMCP(); 910 break; 911 case DEFAULT_CHARSET: 912 cp = GetACP(); 913 break; 914 915 case VISCII_CHARSET: 916 case TCVN_CHARSET: 917 case KOI8_CHARSET: 918 case ISO3_CHARSET: 919 case ISO4_CHARSET: 920 /* FIXME: These have no place here, but because x11drv 921 enumerates fonts with these (made up) charsets some apps 922 might use them and then the FIXME below would become 923 annoying. Now we could pick the intended codepage for 924 each of these, but since it's broken anyway we'll just 925 use CP_ACP and hope it'll go away... 926 */ 927 cp = CP_ACP; 928 break; 929 930 931 default: 932 dprintf(("Can't find codepage for charset %d\n", charset)); 933 break; 934 } 930 935 } 931 936 … … 935 940 if(cp != CP_SYMBOL) { 936 941 lenW = MultiByteToWideChar(cp, 0, str, count, NULL, 0); 937 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));938 MultiByteToWideChar(cp, 0, str, count, strW, lenW);942 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 943 MultiByteToWideChar(cp, 0, str, count, strW, lenW); 939 944 } else { 940 945 lenW = count; 941 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR));942 for(i = 0; i < count; i++) strW[i] = (BYTE)str[i];946 strW = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, (lenW + 1) * sizeof(WCHAR)); 947 for(i = 0; i < count; i++) strW[i] = (BYTE)str[i]; 943 948 } 944 949 strW[lenW] = '\0'; … … 953 958 */ 954 959 DWORD WINAPI GetGlyphIndicesA(HDC hdc, LPCSTR lpstr, INT count, 955 LPWORD pgi, DWORD flags)960 LPWORD pgi, DWORD flags) 956 961 { 957 962 DWORD ret; … … 973 978 */ 974 979 DWORD WINAPI GetGlyphIndicesW(HDC hdc, LPCWSTR lpstr, INT count, 975 LPWORD pgi, DWORD flags)980 LPWORD pgi, DWORD flags) 976 981 { 977 982 DWORD ret; … … 982 987 if(!hdc) return GDI_ERROR; 983 988 984 ret = FT2Module.Ft2GetGlyphIndices(hdc, lpstr, count , pgi, flags); 989 ret = FT2Module.Ft2GetGlyphIndices(hdc, lpstr, count , pgi, flags); 985 990 if(ret != GDI_ERROR) { 986 991 for(int i=0;i<ret;i++) { … … 1007 1012 if (p) 1008 1013 { 1009 c = p[0];1010 }1011 else1012 {1014 c = p[0]; 1015 } 1016 else 1017 { 1013 1018 SetLastError(ERROR_NOT_ENOUGH_MEMORY); 1014 return GDI_ERROR;1015 }1019 return GDI_ERROR; 1020 } 1016 1021 } 1017 1022 else … … 1019 1024 c = uChar; 1020 1025 } 1021 1026 1022 1027 ret = GetGlyphOutlineW (hdc, c, fuFormat, lpgm, cbBuffer, lpBuffer, lpmat2); 1023 1028 1024 1029 if (p != NULL) 1025 1030 { 1026 1031 HeapFree (GetProcessHeap(), 0, p); 1027 1032 } 1028 1033 1029 1034 return ret; 1030 1035 }
Note:
See TracChangeset
for help on using the changeset viewer.
