diff --git a/src/battle_interface.c b/src/battle_interface.c index 60b555fdcf..8d50bf95c3 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1743,7 +1743,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon) break; } - windowTileData = AddTextPrinterAndCreateWindowOnHealthboxToFit(gDisplayedStringBattle, 0, 3, 2, &windowId, 54); + windowTileData = AddTextPrinterAndCreateWindowOnHealthboxToFit(gDisplayedStringBattle, 0, 3, 2, &windowId, 55); spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP; diff --git a/test/text.c b/test/text.c index e8eb4f7f24..0e6900edad 100644 --- a/test/text.c +++ b/test/text.c @@ -275,7 +275,7 @@ TEST("Item names fit on Shop Screen") TEST("Species names fit on Battle Screen HP box") { u32 i, genderWidthPx; - const u32 fontId = FONT_SMALL_NARROWER, widthPx = 54; + const u32 fontId = FONT_SMALL_NARROWER, widthPx = 55; u32 species = SPECIES_NONE; genderWidthPx = GetStringWidth(fontId, COMPOUND_STRING("♂"), 0); for (i = 1; i < NUM_SPECIES; i++) @@ -501,6 +501,25 @@ TEST("Species names fit on PokeNav Ribbon List Screen") EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0), widthPx); } +TEST("Species names fit on Battle Screen HP box for vanilla mons with the default font") +{ + u32 i, genderWidthPx; + const u32 fontId = FONT_SMALL, widthPx = 55; + u32 species = SPECIES_NONE; + genderWidthPx = GetStringWidth(fontId, COMPOUND_STRING("♂"), 0); + for (i = 1; i < SPECIES_TURTWIG; i++) + { + if (IsSpeciesEnabled(i)) + { + PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; } + } + } + if (gSpeciesInfo[i].genderRatio != MON_GENDERLESS) + EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0) - genderWidthPx, widthPx); + else + EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0), widthPx); +} + TEST("Ability names fit on Pokemon Summary Screen") { u32 i;