Skip to content

Commit

Permalink
Added FONT_SHORT_NARROWER (#5101)
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo authored Dec 4, 2024
1 parent 70224f0 commit 5c180a0
Show file tree
Hide file tree
Showing 10 changed files with 249 additions and 1 deletion.
1 change: 1 addition & 0 deletions charmap.txt
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ FONT_SMALL_NARROW = FC 06 08
FONT_NARROWER = FC 06 0A
FONT_SMALL_NARROWER = FC 06 0B
FONT_SHORT_NARROW = FC 06 0C
FONT_SHORT_NARROWER = FC 06 0D

@ colors

Expand Down
119 changes: 119 additions & 0 deletions data/scripts/debug.inc
Original file line number Diff line number Diff line change
Expand Up @@ -447,3 +447,122 @@ Debug_EventScript_EWRAMCounters::
Debug_EventScript_EWRAMCounters_Text::
.string "Follower Steps: {STR_VAR_1}.\n"
.string "Fishing Chain: {STR_VAR_2}.$"

Debug_EventScript_FontTest_Text_1::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Angel Adept Blind Bodice Clique\n"
.string "Coast Dunce Docile Enact Eosin\l"
.string "Furlong Focal Gnome Gondola Human\l"
.string "Hoist Inlet Iodine Justin Jocose\l"
.string "Knoll Koala Linden Loads Milliner\l"
.string "Modal Number Nodule Onset Oddball\l"
.string "Pneumo Poncho Quanta Qophs Rhone\l"
.string "Roman Snout Sodium Tundra Tocsin\l"
.string "Uncle Udder Vulcan Vocal Whale\l"
.string "Woman Xmas Xenon Yunnan Young\l"
.string "Zloty Zodiac.$"

Debug_EventScript_FontTest_Text_2::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Angel angel adept for the nuance loads\n"
.string "of the arena cocoa and quaalude. Blind\l"
.string "blind bodice for the submit oboe of the\l"
.string "club snob and abbot. Clique clique\l"
.string "coast for the pouch loco of the franc\l"
.string "assoc and accede. Dunce dunce docile\l"
.string "for the loudness mastodon of the\l"
.string "loud statehood and huddle.$"

Debug_EventScript_FontTest_Text_3::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Enact enact eosin for the quench coed\n"
.string "of the pique canoe and bleep. Furlong\l"
.string "furlong focal for the genuflect\l"
.string "profound of the motif aloof and offers.\l"
.string "Gnome gnome gondola for the impugn\l"
.string "logos of the unplug analog and smuggle.\l"
.string "Human human hoist for the buddhist\l"
.string "alcohol of the riyadh caliph and\l"
.string "bathhouse.$"

Debug_EventScript_FontTest_Text_4::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Inlet inlet iodine for the quince\n"
.string "champion of the ennui scampi and shiite.\l"
.string "Justin justin jocose for the djibouti\l"
.string "sojourn of the oranj raj and hajjis.\l"
.string "Knoll knoll koala for the banknote\l"
.string "lookout of the dybbuk outlook and\l"
.string "trekked. Linden linden loads for the\l"
.string "ulna monolog of the consul menthol and\l"
.string "shallot.$"

Debug_EventScript_FontTest_Text_5::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Milliner milliner modal for the alumna\n"
.string "solomon of the album custom and summon.\l"
.string "Number number nodule for the unmade\l"
.string "economic of the shotgun bison and\l"
.string "tunnel. Onset onset oddball for the\l"
.string "abandon podium of the antiquo tempo\l"
.string "and moonlit. Pneumo pneumo poncho for\l"
.string "the dauphin opossum of the holdup\l"
.string "bishop and supplies.$"

Debug_EventScript_FontTest_Text_6::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Quanta quanta qophs for the inquest\n"
.string "sheqel of the cinq coq and suqqu. Rhone\l"
.string "rhone roman for the burnt porous of the\l"
.string "lemur clamor and carrot. Snout snout\l"
.string "sodium for the ensnare bosom of the\l"
.string "genus pathos and missing. Tundra\l"
.string "tundra tocsin for the nutmeg isotope\l"
.string "of the peasant ingot and ottoman.$"

Debug_EventScript_FontTest_Text_7::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Uncle uncle udder for the dunes cloud\n"
.string "of the hindu thou and continuum. Vulcan\l"
.string "vulcan vocal for the alluvial ovoid of\l"
.string "the yugoslav chekhov and revved. Whale\l"
.string "whale woman for the meanwhile blowout\l"
.string "of the forepaw meadow and glowworm.\l"
.string "Xmas xmas xenon for the bauxite\l"
.string "doxology of the tableaux equinox and\l"
.string "exxon.$"

Debug_EventScript_FontTest_Text_8::
.string "{FONT_SHORT_NARROWER}" @ Edit this to test your font
.string "Yunnan yunnan young for the dynamo\n"
.string "coyote of the obloquy employ and\l"
.string "sayyid. Zloty zloty zodiac for the gizmo\l"
.string "ozone of the franz laissez and buzzing.$"

Debug_PrintFontTest::
msgbox Debug_EventScript_FontTest_Text_1, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_2, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_3, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_4, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_5, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_6, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_7, MSGBOX_DEFAULT
msgbox Debug_EventScript_FontTest_Text_8, MSGBOX_DEFAULT
releaseall
end

Debug_EventScript_FontTest::
lockall
goto Debug_PrintFontTest
@ goto_if_eq VAR_RESULT, 0, Debug_NoPokemon
@ dynmultipush Debug_EventScript_InflictStatus1_Text_Single, 0
@ dynmultipush Debug_EventScript_InflictStatus1_Text_PartyWide, 1
@ dynmultipush Debug_EventScript_InflictStatus1_Text_Close, 2
@ dynmultistack 0, 0, FALSE, 3 FALSE, 0, NULL
@ switch VAR_RESULT
@ case 0, Debug_EventScript_InflictStatus1_Single
@ case 1, Debug_EventScript_InflictStatus1_Party
@ case 2, Debug_EventScript_InflictStatus1_Close
@Debug_EventScript_InflictStatus1_Close:
@ releaseall
@ end
Binary file added graphics/fonts/latin_short_narrower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified graphics/fonts/latin_small_narrower.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions graphics_file_rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ $(FONTGFXDIR)/small_narrower.latfont: $(FONTGFXDIR)/latin_small_narrower.png
$(FONTGFXDIR)/short_narrow.latfont: $(FONTGFXDIR)/latin_short_narrow.png
$(GFX) $< $@

$(FONTGFXDIR)/short_narrower.latfont: $(FONTGFXDIR)/latin_short_narrower.png
$(GFX) $< $@

$(FONTGFXDIR)/small.hwjpnfont: $(FONTGFXDIR)/japanese_small.png
$(GFX) $< $@

Expand Down
2 changes: 2 additions & 0 deletions include/fonts.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,7 @@ extern const u8 gFontSmallNarrowerLatinGlyphWidths[];
extern const u16 gFontSmallNarrowerLatinGlyphs[];
extern const u8 gFontShortNarrowLatinGlyphWidths[];
extern const u16 gFontShortNarrowLatinGlyphs[];
extern const u8 gFontShortNarrowerLatinGlyphWidths[];
extern const u16 gFontShortNarrowerLatinGlyphs[];

#endif // GUARD_FONTS_H
1 change: 1 addition & 0 deletions include/text.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ enum {
FONT_NARROWER,
FONT_SMALL_NARROWER,
FONT_SHORT_NARROW,
FONT_SHORT_NARROWER,
};

// Return values for font functions
Expand Down
11 changes: 11 additions & 0 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ enum UtilDebugMenu
DEBUG_UTIL_MENU_ITEM_SAVEBLOCK,
DEBUG_UTIL_MENU_ITEM_ROM_SPACE,
DEBUG_UTIL_MENU_ITEM_WEATHER,
DEBUG_UTIL_MENU_ITEM_FONT_TEST,
DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK,
DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK,
DEBUG_UTIL_MENU_ITEM_WATCHCREDITS,
Expand Down Expand Up @@ -365,6 +366,7 @@ static void DebugAction_Util_CheckSaveBlock(u8 taskId);
static void DebugAction_Util_CheckROMSpace(u8 taskId);
static void DebugAction_Util_Weather(u8 taskId);
static void DebugAction_Util_Weather_SelectId(u8 taskId);
static void DebugAction_Util_FontTest(u8 taskId);
static void DebugAction_Util_CheckWallClock(u8 taskId);
static void DebugAction_Util_SetWallClock(u8 taskId);
static void DebugAction_Util_WatchCredits(u8 taskId);
Expand Down Expand Up @@ -453,6 +455,7 @@ static void DebugAction_BerryFunctions_Weeds(u8 taskId);
extern const u8 Debug_FlagsNotSetOverworldConfigMessage[];
extern const u8 Debug_FlagsNotSetBattleConfigMessage[];
extern const u8 Debug_FlagsAndVarNotSetBattleConfigMessage[];
extern const u8 Debug_EventScript_FontTest[];
extern const u8 Debug_EventScript_CheckEVs[];
extern const u8 Debug_EventScript_CheckIVs[];
extern const u8 Debug_EventScript_InflictStatus1[];
Expand Down Expand Up @@ -525,6 +528,7 @@ static const u8 sDebugText_Util_SaveBlockSpace[] = _("Save Block space
static const u8 sDebugText_Util_ROMSpace[] = _("ROM space…{CLEAR_TO 110}{RIGHT_ARROW}");
static const u8 sDebugText_Util_Weather[] = _("Set weather…{CLEAR_TO 110}{RIGHT_ARROW}");
static const u8 sDebugText_Util_Weather_ID[] = _("Weather ID: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}");
static const u8 sDebugText_Util_FontTest[] = _("Font Test…{CLEAR_TO 110}{RIGHT_ARROW}");
static const u8 sDebugText_Util_CheckWallClock[] = _("Check wall clock…{CLEAR_TO 110}{RIGHT_ARROW}");
static const u8 sDebugText_Util_SetWallClock[] = _("Set wall clock…{CLEAR_TO 110}{RIGHT_ARROW}");
static const u8 sDebugText_Util_WatchCredits[] = _("Watch credits…{CLEAR_TO 110}{RIGHT_ARROW}");
Expand Down Expand Up @@ -714,6 +718,7 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] =
[DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {sDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK},
[DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = {sDebugText_Util_ROMSpace, DEBUG_UTIL_MENU_ITEM_ROM_SPACE},
[DEBUG_UTIL_MENU_ITEM_WEATHER] = {sDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER},
[DEBUG_UTIL_MENU_ITEM_FONT_TEST] = {sDebugText_Util_FontTest, DEBUG_UTIL_MENU_ITEM_FONT_TEST},
[DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {sDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK},
[DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {sDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK},
[DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {sDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS},
Expand Down Expand Up @@ -884,6 +889,7 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) =
[DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock,
[DEBUG_UTIL_MENU_ITEM_ROM_SPACE] = DebugAction_Util_CheckROMSpace,
[DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather,
[DEBUG_UTIL_MENU_ITEM_FONT_TEST] = DebugAction_Util_FontTest,
[DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock,
[DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock,
[DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits,
Expand Down Expand Up @@ -2294,6 +2300,11 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId)
}
}

static void DebugAction_Util_FontTest(u8 taskId)
{
Debug_DestroyMenu_Full_Script(taskId, Debug_EventScript_FontTest);
}

static void DebugAction_Util_CheckWallClock(u8 taskId)
{
Debug_DestroyMenu_Full_Script(taskId, PlayersHouse_2F_EventScript_CheckWallClock);
Expand Down
36 changes: 36 additions & 0 deletions src/fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,42 @@ ALIGNED(4) const u8 gFontShortNarrowLatinGlyphWidths[] = {
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3,
};

ALIGNED(4) const u16 gFontShortNarrowerLatinGlyphs[] = INCBIN_U16("graphics/fonts/short_narrower.latfont");
ALIGNED(4) const u8 gFontShortNarrowerLatinGlyphWidths[] = {
1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 4, 4, 4, 4, 4,
8, 4, 4, 4, 5, 5, 4, 4, 3, 4, 4, 4, 4, 4, 4, 3,
4, 4, 4, 4, 4, 6, 4, 4, 4, 5, 4, 5, 8, 6, 6, 3,
3, 3, 3, 3, 8, 8, 3, 5, 5, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
5, 5, 4, 8, 8, 8, 7, 8, 8, 4, 4, 6, 4, 4, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 3, 3, 3, 3, 4,
3, 3, 3, 3, 3, 3, 3, 5, 3, 7, 7, 7, 7, 0, 0, 3,
4, 5, 6, 7, 4, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 3, 5, 3,
5, 5, 5, 3, 3, 5, 5, 6, 3, 6, 6, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 4,
4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4,
2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8,
4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3,
10, 10, 10, 10, 8, 8, 10, 8, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 3,
};

ALIGNED(4) const u16 gFontSmallJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/small.hwjpnfont");
ALIGNED(4) const u16 gFontNormalJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/normal.hwjpnfont");

Expand Down
Loading

0 comments on commit 5c180a0

Please sign in to comment.