Ability to specify fonts on a per-locale basis

Add to the list found in `src/fonts.c` (use language IDs
found in `src/i18n.h`, e.g. "LANG_DE" for German).
h/t Shin-ichi for the suggestion

Closes https://sourceforge.net/p/tuxpaint/feature-requests/240/
This commit is contained in:
Bill Kendrick 2023-06-08 00:40:43 -07:00
parent 1f623cbe36
commit 3c8f25e6e9
4 changed files with 43 additions and 4 deletions

View file

@ -27921,6 +27921,7 @@ static void setup_config(char *argv[])
{
char str[128];
char *picturesdir;
int i;
#if !defined(_WIN32) && !defined(__ANDROID__)
const char *home = getenv("HOME");
@ -28097,6 +28098,15 @@ static void setup_config(char *argv[])
tmpcfg.parsertmp_locale = NULL;
button_label_y_nudge = setup_i18n(tmpcfg.parsertmp_lang, tmpcfg.parsertmp_locale, &num_wished_langs);
/* Determine the referred font for the current locale */
for (i = 0; default_local_fonts[i].locale_id != -1; i++)
{
if (default_local_fonts[i].locale_id == get_current_language())
{
PANGO_DEFAULT_FONT = default_local_fonts[i].font_name;
}
}
if (tmpcfg.tp_ui_font)
{
char * tmp_str;