@@ -67,6 +67,7 @@ void fontInit() {
6767 palette[3 ] = 0x94A5 ;
6868 }
6969 tinyFont = new FontGraphic ({" nitro:/graphics/font/tiny.nftr" }, false );
70+ tinyFont->setFixedWidthChar (' A' ); // tiny font has tiny fixed-width
7071
7172 if (colorTable) {
7273 for (uint i = 1 ; i < sizeof (palette)/sizeof (u16 ); i++) {
@@ -99,7 +100,7 @@ void updateText(bool top) {
99100 for (auto it = text.begin (); it != text.end (); ++it) {
100101 FontGraphic *font = getFont (it->large );
101102 if (font)
102- font->print (it->x , it->y , top, it->message , it->align , it->palette );
103+ font->print (it->x , it->y , top, it->message , it->align , it->palette , false , it-> monospaced );
103104 }
104105 text.clear ();
105106
@@ -132,17 +133,31 @@ void clearText() {
132133}
133134
134135void printSmall (bool top, int x, int y, std::string_view message, Alignment align, FontPalette palette) {
135- getTextQueue (top).emplace_back (false , x, y, message, align, palette);
136+ getTextQueue (top).emplace_back (false , false , x, y, message, align, palette);
136137}
137138void printSmall (bool top, int x, int y, std::u16string_view message, Alignment align, FontPalette palette) {
138- getTextQueue (top).emplace_back (false , x, y, message, align, palette);
139+ getTextQueue (top).emplace_back (false , false , x, y, message, align, palette);
140+ }
141+
142+ void printSmallMonospaced (bool top, int x, int y, std::string_view message, Alignment align, FontPalette palette) {
143+ getTextQueue (top).emplace_back (false , true , x, y, message, align, palette);
144+ }
145+ void printSmallMonospaced (bool top, int x, int y, std::u16string_view message, Alignment align, FontPalette palette) {
146+ getTextQueue (top).emplace_back (false , true , x, y, message, align, palette);
139147}
140148
141149void printTiny (bool top, int x, int y, std::string_view message, Alignment align, FontPalette palette) {
142- getTextQueue (top).emplace_back (true , x, y, message, align, palette);
150+ getTextQueue (top).emplace_back (true , false , x, y, message, align, palette);
143151}
144152void printTiny (bool top, int x, int y, std::u16string_view message, Alignment align, FontPalette palette) {
145- getTextQueue (top).emplace_back (true , x, y, message, align, palette);
153+ getTextQueue (top).emplace_back (true , false , x, y, message, align, palette);
154+ }
155+
156+ void printTinyMonospaced (bool top, int x, int y, std::string_view message, Alignment align, FontPalette palette) {
157+ getTextQueue (top).emplace_back (true , true , x, y, message, align, palette);
158+ }
159+ void printTinyMonospaced (bool top, int x, int y, std::u16string_view message, Alignment align, FontPalette palette) {
160+ getTextQueue (top).emplace_back (true , true , x, y, message, align, palette);
146161}
147162
148163int calcSmallFontWidth (std::string_view text) {
0 commit comments