Added FONT_SHORT_NARROWER (#5101)
This commit is contained in:
parent
70224f0ea3
commit
5c180a0b09
10 changed files with 249 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
graphics/fonts/latin_short_narrower.png
Normal file
BIN
graphics/fonts/latin_short_narrower.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 4.3 KiB |
|
@ -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) $< $@
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -21,6 +21,7 @@ enum {
|
|||
FONT_NARROWER,
|
||||
FONT_SMALL_NARROWER,
|
||||
FONT_SHORT_NARROW,
|
||||
FONT_SHORT_NARROWER,
|
||||
};
|
||||
|
||||
// Return values for font functions
|
||||
|
|
11
src/debug.c
11
src/debug.c
|
@ -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,
|
||||
|
@ -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);
|
||||
|
@ -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[];
|
||||
|
@ -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}");
|
||||
|
@ -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},
|
||||
|
@ -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,
|
||||
|
@ -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);
|
||||
|
|
36
src/fonts.c
36
src/fonts.c
|
@ -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");
|
||||
|
||||
|
|
77
src/text.c
77
src/text.c
|
@ -26,6 +26,7 @@ static u16 FontFunc_SmallNarrow(struct TextPrinter *);
|
|||
static u16 FontFunc_Narrower(struct TextPrinter *);
|
||||
static u16 FontFunc_SmallNarrower(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortNarrow(struct TextPrinter *);
|
||||
static u16 FontFunc_ShortNarrower(struct TextPrinter *);
|
||||
static void DecompressGlyph_Small(u16, bool32);
|
||||
static void DecompressGlyph_Normal(u16, bool32);
|
||||
static void DecompressGlyph_Short(u16, bool32);
|
||||
|
@ -35,6 +36,7 @@ static void DecompressGlyph_Bold(u16);
|
|||
static void DecompressGlyph_Narrower(u16, bool32);
|
||||
static void DecompressGlyph_SmallNarrower(u16, bool32);
|
||||
static void DecompressGlyph_ShortNarrow(u16, bool32);
|
||||
static void DecompressGlyph_ShortNarrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_Small(u16, bool32);
|
||||
static u32 GetGlyphWidth_Normal(u16, bool32);
|
||||
static u32 GetGlyphWidth_Short(u16, bool32);
|
||||
|
@ -43,6 +45,7 @@ static u32 GetGlyphWidth_SmallNarrow(u16, bool32);
|
|||
static u32 GetGlyphWidth_Narrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_SmallNarrower(u16, bool32);
|
||||
static u32 GetGlyphWidth_ShortNarrow(u16, bool32);
|
||||
static u32 GetGlyphWidth_ShortNarrower(u16, bool32);
|
||||
|
||||
static EWRAM_DATA struct TextPrinter sTempTextPrinter = {0};
|
||||
static EWRAM_DATA struct TextPrinter sTextPrinters[WINDOWS_MAX] = {0};
|
||||
|
@ -102,6 +105,7 @@ static const struct GlyphWidthFunc sGlyphWidthFuncs[] =
|
|||
{ FONT_NARROWER, GetGlyphWidth_Narrower },
|
||||
{ FONT_SMALL_NARROWER, GetGlyphWidth_SmallNarrower },
|
||||
{ FONT_SHORT_NARROW, GetGlyphWidth_ShortNarrow },
|
||||
{ FONT_SHORT_NARROWER, GetGlyphWidth_ShortNarrower },
|
||||
};
|
||||
|
||||
struct
|
||||
|
@ -260,6 +264,16 @@ static const struct FontInfo sFontInfos[] =
|
|||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
[FONT_SHORT_NARROWER] = {
|
||||
.fontFunction = FontFunc_ShortNarrower,
|
||||
.maxLetterWidth = 5,
|
||||
.maxLetterHeight = 14,
|
||||
.letterSpacing = 0,
|
||||
.lineSpacing = 0,
|
||||
.fgColor = 2,
|
||||
.bgColor = 1,
|
||||
.shadowColor = 3,
|
||||
},
|
||||
};
|
||||
|
||||
static const u8 sMenuCursorDimensions[][2] =
|
||||
|
@ -277,6 +291,7 @@ static const u8 sMenuCursorDimensions[][2] =
|
|||
[FONT_NARROWER] = { 8, 15 },
|
||||
[FONT_SMALL_NARROWER] = { 8, 8 },
|
||||
[FONT_SHORT_NARROW] = { 8, 14 },
|
||||
[FONT_SHORT_NARROWER] = { 8, 14 },
|
||||
};
|
||||
|
||||
static const u16 sFontBoldJapaneseGlyphs[] = INCBIN_U16("graphics/fonts/bold.hwjpnfont");
|
||||
|
@ -850,6 +865,18 @@ static u16 FontFunc_ShortNarrow(struct TextPrinter *textPrinter)
|
|||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
static u16 FontFunc_ShortNarrower(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
||||
if (subStruct->hasFontIdBeenSet == FALSE)
|
||||
{
|
||||
subStruct->fontId = FONT_SHORT_NARROWER;
|
||||
subStruct->hasFontIdBeenSet = TRUE;
|
||||
}
|
||||
return RenderText(textPrinter);
|
||||
}
|
||||
|
||||
void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
|
||||
{
|
||||
struct TextPrinterSubStruct *subStruct = (struct TextPrinterSubStruct *)(&textPrinter->subStructFields);
|
||||
|
@ -1238,6 +1265,9 @@ static u16 RenderText(struct TextPrinter *textPrinter)
|
|||
case FONT_SHORT_NARROW:
|
||||
DecompressGlyph_ShortNarrow(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_SHORT_NARROWER:
|
||||
DecompressGlyph_ShortNarrower(currChar, textPrinter->japanese);
|
||||
break;
|
||||
case FONT_BRAILLE:
|
||||
break;
|
||||
}
|
||||
|
@ -2161,6 +2191,50 @@ static u32 GetGlyphWidth_ShortNarrow(u16 glyphId, bool32 isJapanese)
|
|||
return gFontShortNarrowLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static void DecompressGlyph_ShortNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
const u16 *glyphs;
|
||||
|
||||
if (isJapanese == TRUE)
|
||||
{
|
||||
glyphs = gFontShortJapaneseGlyphs + (0x100 * (glyphId >> 0x3)) + (0x10 * (glyphId & 0x7));
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x80, gCurGlyph.gfxBufferBottom); // gCurGlyph + 0x20
|
||||
DecompressGlyphTile(glyphs + 0x88, gCurGlyph.gfxBufferBottom + 8); // gCurGlyph + 0x60
|
||||
gCurGlyph.width = gFontShortJapaneseGlyphWidths[glyphId];
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
else
|
||||
{
|
||||
glyphs = gFontShortNarrowerLatinGlyphs + (0x20 * glyphId);
|
||||
gCurGlyph.width = gFontShortNarrowerLatinGlyphWidths[glyphId];
|
||||
|
||||
if (gCurGlyph.width <= 8)
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
}
|
||||
else
|
||||
{
|
||||
DecompressGlyphTile(glyphs, gCurGlyph.gfxBufferTop);
|
||||
DecompressGlyphTile(glyphs + 0x8, gCurGlyph.gfxBufferTop + 8);
|
||||
DecompressGlyphTile(glyphs + 0x10, gCurGlyph.gfxBufferBottom);
|
||||
DecompressGlyphTile(glyphs + 0x18, gCurGlyph.gfxBufferBottom + 8);
|
||||
}
|
||||
|
||||
gCurGlyph.height = 14;
|
||||
}
|
||||
}
|
||||
|
||||
static u32 GetGlyphWidth_ShortNarrower(u16 glyphId, bool32 isJapanese)
|
||||
{
|
||||
if (isJapanese == TRUE)
|
||||
return gFontShortJapaneseGlyphWidths[glyphId];
|
||||
else
|
||||
return gFontShortNarrowerLatinGlyphWidths[glyphId];
|
||||
}
|
||||
|
||||
static const s8 sNarrowerFontIds[] =
|
||||
{
|
||||
[FONT_SMALL] = FONT_SMALL_NARROW,
|
||||
|
@ -2175,7 +2249,8 @@ static const s8 sNarrowerFontIds[] =
|
|||
[FONT_BOLD] = -1,
|
||||
[FONT_NARROWER] = -1,
|
||||
[FONT_SMALL_NARROWER] = -1,
|
||||
[FONT_SHORT_NARROW] = -1,
|
||||
[FONT_SHORT_NARROW] = FONT_SHORT_NARROWER,
|
||||
[FONT_SHORT_NARROWER] = -1,
|
||||
};
|
||||
|
||||
// If the narrowest font ID doesn't fit the text, we still return that
|
||||
|
|
Loading…
Reference in a new issue