From <Someone>
This was caused by character set incompatibility between message and map windows. Apparently, Nethack is using IBM character set (CP 437) but fonts were create for Windows ANSI codepage. I fixed most of it by changing character set of the fonts except for the Rogue level. I had to make changes to src/drawing.c for Rogue level since most of Windows fonts are not capable of displaying control characters (char. code<0x20) And of course, disabling IBMGraphics option fixes it all.
This commit is contained in:
@@ -741,7 +741,7 @@ static const uchar r_oc_syms[MAXOCLASSES] = {
|
||||
static const uchar IBM_r_oc_syms[MAXOCLASSES] = { /* a la EPYX Rogue */
|
||||
/* 0*/ '\0',
|
||||
ILLOBJ_SYM,
|
||||
# if defined(MSDOS) || defined(WIN32) || defined(OS2)
|
||||
# if defined(MSDOS) || defined(OS2) || ( defined(WIN32) && !defined(MSWIN_GRAPHICS) )
|
||||
0x18, /* weapon: up arrow */
|
||||
/* 0x0a, */ ARMOR_SYM, /* armor: Vert rect with o */
|
||||
/* 0x09, */ RING_SYM, /* ring: circle with arrow */
|
||||
@@ -798,6 +798,9 @@ boolean is_rlevel;
|
||||
if (iflags.IBMgraphics
|
||||
# if defined(USE_TILES) && defined(MSDOS)
|
||||
&& !iflags.grmode
|
||||
# endif
|
||||
# if defined(MSWIN_GRAPHICS)
|
||||
&& 0
|
||||
# endif
|
||||
)
|
||||
monsyms[S_HUMAN] = 0x01; /* smiley face */
|
||||
@@ -842,6 +845,7 @@ boolean is_rlevel;
|
||||
showsyms[S_litcorr] = 0xb2;
|
||||
showsyms[S_upstair] = 0xf0; /* Greek Xi */
|
||||
showsyms[S_dnstair] = 0xf0;
|
||||
#ifndef MSWIN_GRAPHICS
|
||||
showsyms[S_arrow_trap] = 0x04; /* diamond (cards) */
|
||||
showsyms[S_dart_trap] = 0x04;
|
||||
showsyms[S_falling_rock_trap] = 0x04;
|
||||
@@ -864,6 +868,7 @@ boolean is_rlevel;
|
||||
showsyms[S_magic_trap] = 0x04;
|
||||
showsyms[S_anti_magic_trap] = 0x04;
|
||||
showsyms[S_polymorph_trap] = 0x04;
|
||||
#endif
|
||||
}
|
||||
#endif /* ASCIIGRAPH */
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ HGDIOBJ mswin_create_font(int win_type, int attr, HDC hdc)
|
||||
lgfnt.lfItalic = FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = DEFAULT_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -63,7 +63,7 @@ HGDIOBJ mswin_create_font(int win_type, int attr, HDC hdc)
|
||||
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 = DEFAULT_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -81,7 +81,7 @@ HGDIOBJ mswin_create_font(int win_type, int attr, HDC hdc)
|
||||
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 = DEFAULT_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
@@ -98,31 +98,13 @@ HGDIOBJ mswin_create_font(int win_type, int attr, HDC hdc)
|
||||
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 = DEFAULT_CHARSET; // character set identifier
|
||||
lgfnt.lfCharSet = OEM_CHARSET; // character set identifier
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
lgfnt.lfPitchAndFamily = FIXED_PITCH; // pitch and family
|
||||
/* lgfnt.lfFaceName */
|
||||
break;
|
||||
|
||||
case NHW_MAP:
|
||||
lgfnt.lfHeight = -TILE_Y; // height of font
|
||||
lgfnt.lfWidth = -TILE_X; // average character width
|
||||
lgfnt.lfEscapement = 0; // angle of escapement
|
||||
lgfnt.lfOrientation = 0; // base-line orientation angle
|
||||
lgfnt.lfWeight = FW_NORMAL; // font weight
|
||||
lgfnt.lfItalic = FALSE; // italic attribute option
|
||||
lgfnt.lfUnderline = FALSE; // underline attribute option
|
||||
lgfnt.lfStrikeOut = FALSE; // strikeout attribute option
|
||||
lgfnt.lfCharSet = DEFAULT_CHARSET; // character set identifier
|
||||
// we need OEM charset for Rogue level
|
||||
lgfnt.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
lgfnt.lfPitchAndFamily = FIXED_PITCH; // pitch and family
|
||||
_tcscpy( lgfnt.lfFaceName, TEXT("Terminal"));
|
||||
break;
|
||||
}
|
||||
|
||||
fnt = CreateFontIndirect(&lgfnt);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include "mhmap.h"
|
||||
#include "mhmsg.h"
|
||||
#include "mhinput.h"
|
||||
#include "mhfont.h"
|
||||
|
||||
#define NHMAP_FONT_NAME TEXT("Terminal")
|
||||
#define MAXWINDOWTEXT 255
|
||||
|
||||
extern short glyph2tile[];
|
||||
@@ -156,7 +156,7 @@ void mswin_map_stretch(HWND hWnd, LPSIZE lpsz, BOOL redraw)
|
||||
lgfnt.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
lgfnt.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
lgfnt.lfPitchAndFamily = FIXED_PITCH; // pitch and family
|
||||
_tcscpy(lgfnt.lfFaceName, TEXT("Terminal"));
|
||||
_tcscpy(lgfnt.lfFaceName, NHMAP_FONT_NAME);
|
||||
data->hMapFont = CreateFontIndirect(&lgfnt);
|
||||
|
||||
mswin_cliparound(data->xCur, data->yCur);
|
||||
|
||||
Reference in New Issue
Block a user