Backed out font codepage change.

This commit is contained in:
Alexandre Julliard 2000-08-25 21:35:11 +00:00
parent 6cd85a5816
commit 2ad1a94d28
5 changed files with 7 additions and 11 deletions

View File

@ -2993,10 +2993,6 @@ HFONT X11DRV_FONT_SelectObject( DC* dc, HFONT hfont, FONTOBJ* font )
hPrevFont = dc->w.hFont; hPrevFont = dc->w.hFont;
dc->w.hFont = hfont; dc->w.hFont = hfont;
dc->w.codepage = CP_ACP;
/* NOTE: the codepage of UNICODE is treated as CP_ACP(=0) */
if ( CHECK_PFONT(physDev->font) )
dc->w.codepage = __PFONT(physDev->font)->fi->codepage;
LeaveCriticalSection( &crtsc_fonts_X11 ); LeaveCriticalSection( &crtsc_fonts_X11 );

View File

@ -134,7 +134,6 @@ typedef struct
XFORM xformWorld2Vport; /* World-to-viewport transformation */ XFORM xformWorld2Vport; /* World-to-viewport transformation */
XFORM xformVport2World; /* Inverse of the above transformation */ XFORM xformVport2World; /* Inverse of the above transformation */
BOOL vport2WorldValid; /* Is xformVport2World valid? */ BOOL vport2WorldValid; /* Is xformVport2World valid? */
WORD codepage; /* codepage of the selected font */
} WIN_DC_INFO; } WIN_DC_INFO;

View File

@ -73,7 +73,6 @@ static void DC_Init_DC_INFO( WIN_DC_INFO *win_dc_info )
win_dc_info->xformWorld2Vport = win_dc_info->xformWorld2Wnd; win_dc_info->xformWorld2Vport = win_dc_info->xformWorld2Wnd;
win_dc_info->xformVport2World = win_dc_info->xformWorld2Wnd; win_dc_info->xformVport2World = win_dc_info->xformWorld2Wnd;
win_dc_info->vport2WorldValid = TRUE; win_dc_info->vport2WorldValid = TRUE;
win_dc_info->codepage = CP_ACP;
PATH_InitGdiPath(&win_dc_info->path); PATH_InitGdiPath(&win_dc_info->path);
} }

View File

@ -890,6 +890,7 @@ BOOL WINAPI GetTextExtentPoint32A( HDC hdc, LPCSTR str, INT count,
LPSIZE size ) LPSIZE size )
{ {
BOOL ret = FALSE; BOOL ret = FALSE;
UINT codepage = CP_ACP; /* FIXME: get codepage of font charset */
DC * dc = DC_GetDCPtr( hdc ); DC * dc = DC_GetDCPtr( hdc );
if (!dc) return FALSE; if (!dc) return FALSE;
@ -899,11 +900,11 @@ BOOL WINAPI GetTextExtentPoint32A( HDC hdc, LPCSTR str, INT count,
/* str may not be 0 terminated so we can't use HEAP_strdupWtoA. /* str may not be 0 terminated so we can't use HEAP_strdupWtoA.
* So we use MultiByteToWideChar. * So we use MultiByteToWideChar.
*/ */
UINT wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,NULL,0); UINT wlen = MultiByteToWideChar(codepage,0,str,count,NULL,0);
LPWSTR p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) ); LPWSTR p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) );
if (p) if (p)
{ {
wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,p,wlen); wlen = MultiByteToWideChar(codepage,0,str,count,p,wlen);
ret = dc->funcs->pGetTextExtentPoint( dc, p, wlen, size ); ret = dc->funcs->pGetTextExtentPoint( dc, p, wlen, size );
HeapFree( GetProcessHeap(), 0, p ); HeapFree( GetProcessHeap(), 0, p );
} }

View File

@ -54,6 +54,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
{ {
DC * dc = DC_GetDCUpdate( hdc ); DC * dc = DC_GetDCUpdate( hdc );
LPWSTR p; LPWSTR p;
UINT codepage = CP_ACP; /* FIXME: get codepage of font charset */
BOOL ret = FALSE; BOOL ret = FALSE;
LPINT lpDxW = NULL; LPINT lpDxW = NULL;
@ -61,7 +62,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
if (dc->funcs->pExtTextOut) if (dc->funcs->pExtTextOut)
{ {
UINT wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,NULL,0); UINT wlen = MultiByteToWideChar(codepage,0,str,count,NULL,0);
if (lpDx) if (lpDx)
{ {
int i = 0, j = 0; int i = 0, j = 0;
@ -69,7 +70,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
lpDxW = (LPINT)HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT)); lpDxW = (LPINT)HeapAlloc( GetProcessHeap(), 0, wlen*sizeof(INT));
while(i < count) while(i < count)
{ {
if(IsDBCSLeadByteEx(dc->w.codepage, str[i])) if(IsDBCSLeadByteEx(codepage, str[i]))
{ {
lpDxW[j++] = lpDx[i] + lpDx[i+1]; lpDxW[j++] = lpDx[i] + lpDx[i+1];
i = i + 2; i = i + 2;
@ -83,7 +84,7 @@ BOOL WINAPI ExtTextOutA( HDC hdc, INT x, INT y, UINT flags,
} }
if ((p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) ))) if ((p = HeapAlloc( GetProcessHeap(), 0, wlen * sizeof(WCHAR) )))
{ {
wlen = MultiByteToWideChar(dc->w.codepage,0,str,count,p,wlen); wlen = MultiByteToWideChar(codepage,0,str,count,p,wlen);
ret = dc->funcs->pExtTextOut( dc, x, y, flags, lprect, p, wlen, lpDxW ); ret = dc->funcs->pExtTextOut( dc, x, y, flags, lprect, p, wlen, lpDxW );
HeapFree( GetProcessHeap(), 0, p ); HeapFree( GetProcessHeap(), 0, p );
} }