From 93a8fd881587a0ff2386784c5f181c28f52f42f4 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Sun, 2 Jun 2024 11:09:05 -0700 Subject: [PATCH] Drop `button_label_y_nudge`; no longer needed (part 2) Apparently `git push`-ed before I was done. The rest of https://sourceforge.net/p/tuxpaint/tuxpaint/ci/8db84be008a797f04b2d8557cb0c196c74da5059/ --- docs/CHANGES.txt | 4 ++++ src/i18n.c | 30 +++++------------------------- src/i18n.h | 6 +++--- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index a7af89422..573202aa6 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -87,6 +87,10 @@ https://tuxpaint.org/ (h/t Karl Ove Hufthammer for suggesting) Bill Kendrick + * Removed unnecessary (and now unhelpful) button label text + vertical position nudging (had only been used by Khmer locale). + Bill Kendrick + * Make screen refresh more snappy on macOS. Mark Kim diff --git a/src/i18n.c b/src/i18n.c index a62969ce1..8f8342211 100644 --- a/src/i18n.c +++ b/src/i18n.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - April 30, 2023 + June 14, 2002 - June 2, 2024 */ #include @@ -259,14 +259,6 @@ static int lang_use_right_to_left_word[] = { -1 }; -/* Languages which require a vertical 'nudge' in - * text rendering, and by how much? */ -static int lang_y_nudge[][2] = { - {LANG_KM, 4}, - {-1, -1} -}; - - int need_own_font; int need_right_to_left; int need_right_to_left_word; @@ -1079,9 +1071,8 @@ void mysetenv(const char *name, const char *value) * @return The Y-nudge value for font rendering in the language. */ -static int set_current_language(const char *restrict loc, int *ptr_num_wished_langs) +static void set_current_language(const char *restrict loc, int *ptr_num_wished_langs) { - int i; int j = 0; char *oldloc; char *env_language; @@ -1237,16 +1228,6 @@ static int set_current_language(const char *restrict loc, int *ptr_num_wished_la wished_langs[j].need_own_font = search_int_array(langint, lang_use_own_font); wished_langs[j].need_right_to_left = search_int_array(langint, lang_use_right_to_left); wished_langs[j].need_right_to_left_word = search_int_array(langint, lang_use_right_to_left_word); - for (i = 0; lang_y_nudge[i][0] != -1; i++) - { - // printf("lang_y_nudge[%d][0] = %d\n", i, lang_y_nudge[i][0]); - if (lang_y_nudge[i][0] == langint) - { - wished_langs[j].lang_y_nudge = lang_y_nudge[i][1]; - break; - } - } - j++; env_language_lang = strtok(NULL, ":"); @@ -1279,8 +1260,6 @@ static int set_current_language(const char *restrict loc, int *ptr_num_wished_la DEBUG_PRINTF("lang_prefixes[%d] is \"%s\"\n", get_current_language(), lang_prefixes[get_current_language()]); *ptr_num_wished_langs = num_wished_langs; - - return wished_langs[0].lang_y_nudge; } @@ -1295,7 +1274,7 @@ static int set_current_language(const char *restrict loc, int *ptr_num_wished_la * @param int * a place to return the number of languages we want to use, when scanning stamp descriptions * @return Y-nudge */ -int setup_i18n(const char *restrict lang, const char *restrict locale, int *num_wished_langs) +void setup_i18n(const char *restrict lang, const char *restrict locale, int *num_wished_langs) { DEBUG_PRINTF("lang %p, locale %p\n", lang, locale); DEBUG_PRINTF("lang \"%s\", locale \"%s\"\n", lang, locale); @@ -1327,5 +1306,6 @@ int setup_i18n(const char *restrict lang, const char *restrict locale, int *num_ if (locale == NULL) locale = ""; - return set_current_language(locale, num_wished_langs); + + set_current_language(locale, num_wished_langs); } diff --git a/src/i18n.h b/src/i18n.h index b9014f493..35fd4df46 100644 --- a/src/i18n.h +++ b/src/i18n.h @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - April 30, 2023 + June 14, 2002 - June 2, 2024 */ @@ -204,7 +204,7 @@ extern w_langs wished_langs[255]; /* Function prototypes: */ int get_current_language(void); -int setup_i18n(const char *restrict lang, const char *restrict locale, int *ptr_num_wished_languages) MUST_CHECK; - void mysetenv(const char *name, const char *value); +void setup_i18n(const char *restrict lang, const char *restrict locale, int *ptr_num_wished_languages); +void mysetenv(const char *name, const char *value); #endif