NH 3.4.0 fonts on Win2K / Japanese (from <Someone>)
Here is one more patch (see attachment). It does TranslateCharsetInfo to map codepage to a character set. I am not sure if it will help though. Japanese Windows is using codepage 932 and I don't think IBMgraphics will work too well in this codepage. AFAIK, there is no way in win32 to force arbitrary codepage for a font (CP 437 in case of Nethack). That means IBMgraphics is unlikely to work if the system locale is set to something other than US or Western Europe (CP 437 & 850). -<Someone>
This commit is contained in:
@@ -34,7 +34,7 @@ void mswin_init_splashfonts(HWND hWnd)
|
||||
lgfnt.lfItalic = FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -87,7 +87,7 @@ HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
|
||||
lgfnt.lfItalic = FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = iflags.IBMgraphics? OEM_CHARSET : ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = mswin_charset(); // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -109,7 +109,7 @@ HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
|
||||
lgfnt.lfItalic = (attr==ATR_BLINK)? TRUE: FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = (attr==ATR_ULINE)? TRUE : FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = iflags.IBMgraphics? OEM_CHARSET : ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = mswin_charset(); // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -132,7 +132,7 @@ HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
|
||||
lgfnt.lfItalic = (attr==ATR_BLINK)? TRUE: FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = (attr==ATR_ULINE)? TRUE : FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = iflags.IBMgraphics? OEM_CHARSET : ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = mswin_charset(); // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -154,7 +154,7 @@ HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
|
||||
lgfnt.lfItalic = (attr==ATR_BLINK)? TRUE: FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = (attr==ATR_ULINE)? TRUE : FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = iflags.IBMgraphics? OEM_CHARSET : ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = mswin_charset(); // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -183,6 +183,21 @@ HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace)
|
||||
return fnt;
|
||||
}
|
||||
|
||||
UINT mswin_charset()
|
||||
{
|
||||
CHARSETINFO cis;
|
||||
if( iflags.IBMgraphics )
|
||||
if( TranslateCharsetInfo((DWORD*)GetOEMCP(), &cis, TCI_SRCCODEPAGE) )
|
||||
return cis.ciCharset;
|
||||
else
|
||||
return OEM_CHARSET;
|
||||
else
|
||||
if( TranslateCharsetInfo((DWORD*)GetACP(), &cis, TCI_SRCCODEPAGE) )
|
||||
return cis.ciCharset;
|
||||
else
|
||||
return ANSI_CHARSET;
|
||||
}
|
||||
|
||||
void __cdecl font_table_cleanup(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -11,5 +11,6 @@
|
||||
HGDIOBJ mswin_get_font(int win_type, int attr, HDC hdc, BOOL replace);
|
||||
void mswin_init_splashfonts(HWND hWnd);
|
||||
void mswin_destroy_splashfonts(void);
|
||||
UINT mswin_charset();
|
||||
|
||||
#endif /* MSWINFont_h */
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "mhmap.h"
|
||||
#include "mhmsg.h"
|
||||
#include "mhinput.h"
|
||||
#include "mhfont.h"
|
||||
|
||||
#include "patchlevel.h"
|
||||
|
||||
@@ -159,7 +160,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
|
||||
lgfnt.lfItalic = FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = iflags.IBMgraphics? OEM_CHARSET : ANSI_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = mswin_charset(); // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
|
||||
Reference in New Issue
Block a user