diff --git a/include/gint/display.h b/include/gint/display.h index 9070163..eb5c97e 100644 --- a/include/gint/display.h +++ b/include/gint/display.h @@ -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 diff --git a/src/render/topti.c b/src/render/topti.c index 6364cab..a087eb0 100644 --- a/src/render/topti.c +++ b/src/render/topti.c @@ -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 */