diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 95d06969f41ef4511865f6f190c9e8c7ad606bdf..34035fd47e578953411096e37fd52b1152a63da6 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -236,7 +236,7 @@ void HU_LoadGraphics(void) HU_SetFontProperties(&tny_font, 0, 2, 12); HU_SetFontProperties(&cred_font, 0, 16, 16); HU_SetFontProperties(<_font, 0, 16, 20); - HU_SetFontProperties(&ntb_font, 0, 4, 21); + HU_SetFontProperties(&ntb_font, 2, 4, 21); HU_SetFontProperties(&nto_font, 0, 4, 21); //cache numbers too! diff --git a/src/v_video.c b/src/v_video.c index 5d308d92ed2214b32b363f7646d1ce2488f7f6e9..75e5a38ed44c7b65314ff99dc52694abf51965d6 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2393,7 +2393,7 @@ static void V_DrawNameTagLine(INT32 x, INT32 y, INT32 option, fixed_t scale, UIN continue; } - w = FixedMul(((ntb_font.chars[c]->width)+2 * dupx) * FRACUNIT, scale); + w = FixedMul(((ntb_font.chars[c]->width)+ntb_font.kerning * dupx) * FRACUNIT, scale); if (FixedInt(cx) > scrwidth) continue; @@ -2519,27 +2519,6 @@ INT32 V_CountNameTagLines(const char *string) return ntlines; } -INT32 V_NameTagWidth(const char *string) -{ - INT32 c, w = 0; - size_t i; - - // It's possible for string to be a null pointer - if (!string) - return 0; - - for (i = 0; i < strlen(string); i++) - { - c = toupper(string[i]) - FONTSTART; - if (c < 0 || c >= FONTSIZE || !ntb_font.chars[c] || !nto_font.chars[c]) - w += ntb_font.spacewidth; - else - w += (ntb_font.chars[c]->width)+2; - } - - return w; -} - // Find string width from supplied font characters & character width. // INT32 V_FontStringWidth(const char *string, INT32 option, fontdef_t font) diff --git a/src/v_video.h b/src/v_video.h index ea96b76a98b854c33161a6937a2912d8b8a93a78..b454da748713e1a928c0effb32ad324010f1ff4c 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -261,7 +261,6 @@ INT16 V_LevelActNumWidth(UINT8 num); // act number width // Draw a string using the nt_font void V_DrawNameTag(INT32 x, INT32 y, INT32 option, fixed_t scale, UINT8 *basecolormap, UINT8 *outlinecolormap, const char *string); INT32 V_CountNameTagLines(const char *string); -INT32 V_NameTagWidth(const char *string); // Find string width or height from supplied font chars INT32 V_FontStringWidth(const char *string, INT32 option, fontdef_t font); @@ -273,6 +272,7 @@ INT32 V_FontStringHeight(const char *string, fontdef_t font); #define V_ThinStringWidth(str,o) V_FontStringWidth(str,o,tny_font) #define V_SmallThinStringWidth(str,o) V_FontStringWidth(str,o,tny_font)/2 #define V_CreditStringWidth(str) V_FontStringWidth(str,0,cred_font) +#define V_NameTagWidth(str) V_FontStringWidth(str,0,ntb_font) #define V_LevelNameWidth(str) V_FontStringWidth(str,V_ALLOWLOWERCASE,lt_font) #define V_LevelNameHeight(str) V_FontStringHeight(str,lt_font)