topti: return previously-configured font in dfont()

pull/7/head
lephe 3 years ago
parent ae4f7af172
commit d7c33b12a5
  1. 5
      include/gint/display.h
  2. 5
      src/render/topti.c

@ -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

@ -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 */

Loading…
Cancel
Save