topti: return previously-configured font in dfont()

This commit is contained in:
lephe 2019-07-27 19:47:04 -04:00
parent ae4f7af172
commit d7c33b12a5
2 changed files with 7 additions and 3 deletions

View File

@ -154,8 +154,9 @@ typedef struct
On fx9860g, the default font is a 5x7 font very close to the system's.
On fxcg50, the default font is an original 8x9 font.
@font Font to use for subsequent text rendering calls */
void dfont(font_t const * font);
@font Font to use for subsequent text rendering calls
Returns the previously configured font. */
font_t const *dfont(font_t const * font);
/* dsize() - get the width and height of rendered text
This function computes the size that the given string would take up if

View File

@ -8,9 +8,12 @@
/* dfont(): Set the default font for text rendering */
GSECTION(".pretext")
void dfont(font_t const * font)
font_t const *dfont(font_t const * font)
{
font_t const *old_font = topti_font;
topti_font = font ? font : gint_default_font;
return old_font;
}
/* charset_size(): Number of elements in each character set */