Better handle of text in buttons.

This commit is contained in:
Pere Pujal i Carabantes 2020-12-16 19:09:27 +01:00
parent a06471974c
commit 1fd1c857dd

View file

@ -25005,7 +25005,7 @@ static void setup(void)
#endif #endif
medium_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT, medium_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT,
DATA_PREFIX "fonts/default_font.ttf", 18 - (only_uppercase * 3)); DATA_PREFIX "fonts/default_font.ttf", (18 - (only_uppercase * 3)) * button_scale);
if (medium_font == NULL) if (medium_font == NULL)
{ {
@ -25337,7 +25337,7 @@ img_btnsm_up, img_btnsm_down, img_btnsm_off, img_btnsm_nav,
/* Load system fonts: */ /* Load system fonts: */
large_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT, large_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT,
DATA_PREFIX "fonts/default_font.ttf", 30 * button_scale - (only_uppercase * 3)); DATA_PREFIX "fonts/default_font.ttf", (30 - (only_uppercase * 3)) * button_scale);
if (large_font == NULL) if (large_font == NULL)
{ {
@ -25353,9 +25353,9 @@ img_btnsm_up, img_btnsm_down, img_btnsm_off, img_btnsm_nav,
small_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT, DATA_PREFIX "fonts/default_font.ttf", small_font = TuxPaint_Font_OpenFont(PANGO_DEFAULT_FONT, DATA_PREFIX "fonts/default_font.ttf",
#ifdef __APPLE__ #ifdef __APPLE__
12 * button_scale - (only_uppercase * 2) (12 - (only_uppercase * 2)) * button_scale
#else #else
13 * button_scale - (only_uppercase * 2) (13 - (only_uppercase * 2)) * button_scale
#endif #endif
); );
@ -25432,7 +25432,7 @@ img_btnsm_up, img_btnsm_down, img_btnsm_off, img_btnsm_nav,
free(td_str); free(td_str);
tmp_surf = render_text(myfont, upstr, black); tmp_surf = render_text(myfont, upstr, black);
free(upstr); free(upstr);
img_title_names[i] = thumbnail(tmp_surf, min(84, tmp_surf->w), tmp_surf->h, 0); img_title_names[i] = thumbnail(tmp_surf, min(84 * button_scale, tmp_surf->w), tmp_surf->h, 0);
SDL_FreeSurface(tmp_surf); SDL_FreeSurface(tmp_surf);
} }
else else