From a952221a9b0ee2a6ee3125a75472fd36fe57fa6f Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Mon, 11 Jan 2016 13:06:33 +0000 Subject: [PATCH] [loc] fix Cyrillic not displaying properly in About dialog * Issue was introduced in 0f56c2d1ef90e754e17610110afeab690f13d767 * Closes #670 --- src/rufus.c | 2 +- src/rufus.rc | 10 +++++----- src/stdlg.c | 16 ++++++++++------ 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/rufus.c b/src/rufus.c index 5452a02d..3cd0987a 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -114,7 +114,6 @@ extern uint8_t* grub2_buf; extern long grub2_len; extern const char* old_c32_name[NB_OLD_C32]; static int selection_default; -static loc_cmd* selected_locale = NULL; static UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU; static RECT relaunch_rc = { -65536, -65536, 0, 0}; static UINT uBootChecked = BST_CHECKED, uQFChecked = BST_CHECKED, uMBRChecked = BST_UNCHECKED; @@ -136,6 +135,7 @@ char* image_path = NULL; float fScale = 1.0f; int default_fs; uint32_t dur_mins, dur_secs; +loc_cmd* selected_locale = NULL; WORD selected_langid = MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT); HWND hDeviceList, hPartitionScheme, hFileSystem, hClusterSize, hLabel, hBootType, hNBPasses, hLog = NULL; HWND hLogDlg = NULL, hProgress = NULL, hInfo, hDiskID, hStatusToolbar; diff --git a/src/rufus.rc b/src/rufus.rc index 103c4fbc..1d7835b3 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -32,7 +32,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 242, 376 STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Rufus 2.7.826" +CAPTION "Rufus 2.7.827" FONT 8, "Segoe UI Symbol", 400, 0, 0x0 BEGIN LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8 @@ -319,8 +319,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 2,7,826,0 - PRODUCTVERSION 2,7,826,0 + FILEVERSION 2,7,827,0 + PRODUCTVERSION 2,7,827,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -337,13 +337,13 @@ BEGIN BEGIN VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "2.7.826" + VALUE "FileVersion", "2.7.827" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "2.7.826" + VALUE "ProductVersion", "2.7.827" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 5c9d9cee..c7f689c5 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -64,6 +64,8 @@ static const notification_info* notification_more_info; static BOOL settings_commcheck = FALSE; static WNDPROC update_original_proc = NULL; +extern loc_cmd* selected_locale; + /* * We need a sub-callback to read the content of the edit box on exit and update * our path, else if what the user typed does match the selection, it is discarded. @@ -1663,15 +1665,17 @@ LPCDLGTEMPLATE GetDialogTemplate(int Dialog_ID) dwBuf[2] = WS_EX_RTLREADING | WS_EX_APPWINDOW | WS_EX_LAYOUTRTL; } - // All our dialogs are set to use 'Segoe UI Symbol': - // 1. So that we can replace the font name with 'MS Shell Dlg' if needed (XP) - // 2. So that Thai displays properly on RTF controls (don't work with regular 'Segoe UI') + // All our dialogs are set to use 'Segoe UI Symbol' by default: + // 1. So that we can replace the font name with 'MS Shell Dlg' (XP) or 'Segoe UI' + // 2. So that Thai displays properly on RTF controls as it won't work with regular + // 'Segoe UI'... but Cyrillic won't work with 'Segoe UI Symbol' - // If 'Segoe UI Symbol' is available, we're done here - if (IsFontAvailable("Segoe UI Symbol")) + // If 'Segoe UI Symbol' is available, and we are using Thai, we're done here + if (IsFontAvailable("Segoe UI Symbol") && (selected_locale != 0) + && (safe_strcmp(selected_locale->txt[0], "th-TH") == 0)) return rcTemplate; - // 'Segoe UI Symbol' is not available => Fall back to the best we have + // 'Segoe UI Symbol' cannot be used => Fall back to the best we have wBuf = (WCHAR*)rcTemplate; wBuf = &wBuf[14]; // Move to class name // Skip class name and title