diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 072bfaa47..74bea7572 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -206,11 +206,13 @@ void HU_LoadGraphics(void) tny_font.chars[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); } - hu_font.width = 8; - hu_font.height = 12; + hu_font.kerning = 0; + hu_font.spacewidth = 4; + hu_font.linespacing = 12; - tny_font.width = 5; - tny_font.height = 12; + tny_font.kerning = 0; + tny_font.spacewidth = 2; + tny_font.linespacing = 12; j = LT_FONTSTART; for (i = 0; i < LT_FONTSIZE; i++) diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 054e8be5d..0e6710220 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -49,8 +49,9 @@ extern char english_shiftxform[]; typedef struct { patch_t *chars[HU_FONTSIZE]; - INT32 width; - INT32 height; + INT32 kerning; + UINT32 spacewidth; + UINT32 linespacing; } fontdef_t; extern fontdef_t hu_font, tny_font; diff --git a/src/v_video.c b/src/v_video.c index 7534ad8e4..5dec382c3 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2166,7 +2166,7 @@ void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 option, fixed_t pscale, INT32 w, c, dupx, dupy, scrwidth, center = 0, left = 0; const char *ch = string; INT32 charflags = (option & V_CHARCOLORMASK); - INT32 spacewidth = font.width/2, charwidth = 0; + INT32 spacewidth = font.spacewidth, charwidth = 0; INT32 lowercase = (option & V_ALLOWLOWERCASE); option &= ~V_FLIP; // which is also shared with V_ALLOWLOWERCASE... @@ -2192,10 +2192,10 @@ void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 option, fixed_t pscale, switch (option & V_SPACINGMASK) // TODO: drop support for these crusty flags in the next major update { case V_MONOSPACE: - spacewidth = font.width; + spacewidth = font.spacewidth*2; /* FALLTHRU */ case V_OLDSPACING: - charwidth = font.width; + charwidth = font.spacewidth*2; break; case V_6WIDTHSPACE: spacewidth = 6; @@ -2221,7 +2221,7 @@ void V_DrawFontStringAtFixed(fixed_t x, fixed_t y, INT32 option, fixed_t pscale, if (option & V_RETURN8) cy += FixedMul((8<= HU_FONTSIZE || !font.chars[c]) w += spacewidth; else - w += (charwidth ? charwidth : (font.chars[c]->width)); + w += (charwidth ? charwidth : (font.chars[c]->width)) + font.kerning; } if (option & (V_NOSCALESTART|V_NOSCALEPATCH))