Add more Unicode tests to testmessage, improve fallback fonts in X11TK (#14042)

This commit is contained in:
eafton
2025-09-25 00:23:27 +03:00
committed by GitHub
parent 2f30f7a6bd
commit f3a9f66292
2 changed files with 110 additions and 10 deletions

View File

@@ -115,14 +115,14 @@ static const char g_ToolkitFontLatin1Fallback[] =
"-*-*-*-*-*--*-*-*-*-*-*-iso8859-1";
static const char *g_ToolkitFont[] = {
"-*-*-medium-r-normal--*-%d-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
"-*-*-medium-r-*--*-%d-*-*-*-*-iso10646-1", // explicitly unicode (iso10646-1)
"-misc-*-*-*-*--*-*-*-*-*-*-iso10646-1", // misc unicode (fix for some systems)
"-*-*-*-*-*--*-*-*-*-*-*-iso10646-1", // just give me anything Unicode.
"-*-*-medium-r-normal--*-%d-*-*-*-*-iso8859-1", // explicitly latin1, in case low-ASCII works out.
"-*-*-medium-r-*--*-%d-*-*-*-*-iso8859-1", // explicitly latin1, in case low-ASCII works out.
"-misc-*-*-*-*--*-*-*-*-*-*-iso8859-1", // misc latin1 (fix for some systems)
"-*-*-*-*-*--*-*-*-*-*-*-iso8859-1", // just give me anything latin1.
"-*-*-medium-r-normal--*-%d-*-*-*-*-iso10646-1,*", // explicitly unicode (iso10646-1)
"-*-*-medium-r-*--*-%d-*-*-*-*-iso10646-1,*", // explicitly unicode (iso10646-1)
"-misc-*-*-*-*--*-*-*-*-*-*-iso10646-1,*", // misc unicode (fix for some systems)
"-*-*-*-*-*--*-*-*-*-*-*-iso10646-1,*", // just give me anything Unicode.
"-*-*-medium-r-normal--*-%d-*-*-*-*-iso8859-1,*", // explicitly latin1, in case low-ASCII works out.
"-*-*-medium-r-*--*-%d-*-*-*-*-iso8859-1,*", // explicitly latin1, in case low-ASCII works out.
"-misc-*-*-*-*--*-*-*-*-*-*-iso8859-1,*", // misc latin1 (fix for some systems)
"-*-*-*-*-*--*-*-*-*-*-*-iso8859-1,*", // just give me anything latin1.
NULL
};
#define G_TOOLKITFONT_SIZE 120

View File

@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
/* Google says this is Traditional Chinese for "beef with broccoli" */
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"牛肉西蘭花",
@@ -193,7 +193,107 @@ int main(int argc, char *argv[])
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
/* Various other Unicode tests */
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Latin",
"Türkçe özellikle çok güzel bir dil.\nBjörn/Bjørn\nÆgypt",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Arabic",
"يتم استخدام أنظمة الكتابة لتسجيل اللغة البشرية.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Cyrillic (Ukranian)",
"Для запису людської мови використовуються системи письма.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Japanese",
"文字体系は人間の言語を記録するために使用されます。",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Indian",
"लेखन प्रणालियों का उपयोग मानव भाषा को रिकॉर्ड करने के लिए किया जाता है।",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Korean",
"문자 체계는 인간의 언어를 기록하는 데 사용됩니다.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Thai",
"ระบบการเขียนใช้เพื่อบันทึกภาษาของมนุษย์",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Greek",
"Τα συστήματα γραφής χρησιμοποιούνται για την καταγραφή της ανθρώπινης γλώσσας.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Hebrew",
"מערכות כתיבה משמשות לרישום שפה אנושית.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Armenian",
"Գրային համակարգերը օգտագործվում են մարդկային լեզուն գրանցելու համար։",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
success = SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
"Georgian",
"წერის სისტემები გამოიყენება ადამიანის ენის ჩასაწერად.",
NULL);
if (!success) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Error Presenting MessageBox: %s", SDL_GetError());
quit(1);
}
button_messagebox(NULL);
/* Test showing a message box from a background thread.