Unicode文字幅の初期値をOSの言語から決定するようにした
- 次の文字幅の初期値(TERATERM.INIに未設定時)
- 従来は1固定だった
- japanese(日本語)、Korean、Chinaの場合は 2 とするようにした
- Tera Term 4 からiniファイルを移行した場合でも違和感なく使えるよう考慮
ticket #45006
@@ -764,6 +764,23 @@ | ||
764 | 764 | ts->EtermLookfeel.BGNoFrame); |
765 | 765 | } |
766 | 766 | |
767 | +/** | |
768 | + * Unicode Ambiguous,Emoji のデフォルト幅 | |
769 | + */ | |
770 | +static int GetDefaultUnicodeWidth(void) | |
771 | +{ | |
772 | + int ret_val = 1; | |
773 | + const int langcode = GetUserDefaultUILanguage(); | |
774 | + if (langcode == 0x0411 || // Japanese | |
775 | + langcode == 0x0412 || // Korean | |
776 | + langcode == 0x0404 || // Chinese (Traditional) | |
777 | + langcode == 0x0804 ) // Chinese (Simplified) | |
778 | + { | |
779 | + ret_val = 2; | |
780 | + } | |
781 | + return ret_val; | |
782 | +} | |
783 | + | |
767 | 784 | void PASCAL ReadIniFile(const wchar_t *FName, PTTSet ts) |
768 | 785 | { |
769 | 786 | int i; |
@@ -2252,14 +2269,14 @@ | ||
2252 | 2269 | &ts->DialogFontPoint, &ts->DialogFontCharSet); |
2253 | 2270 | |
2254 | 2271 | // Unicode設定 |
2255 | - ts->UnicodeAmbiguousWidth = GetPrivateProfileInt(Section, "UnicodeAmbiguousWidth", 1, FName); | |
2272 | + ts->UnicodeAmbiguousWidth = GetPrivateProfileInt(Section, "UnicodeAmbiguousWidth", 0, FName); | |
2256 | 2273 | if (ts->UnicodeAmbiguousWidth < 1 || 2 < ts->UnicodeAmbiguousWidth) { |
2257 | - ts->UnicodeAmbiguousWidth = 1; | |
2274 | + ts->UnicodeAmbiguousWidth = GetDefaultUnicodeWidth(); | |
2258 | 2275 | } |
2259 | 2276 | ts->UnicodeEmojiOverride = (BYTE)GetOnOff(Section, "UnicodeEmojiOverride", FName, FALSE); |
2260 | - ts->UnicodeEmojiWidth = GetPrivateProfileInt(Section, "UnicodeEmojiWidth", 1, FName); | |
2277 | + ts->UnicodeEmojiWidth = GetPrivateProfileInt(Section, "UnicodeEmojiWidth", 0, FName); | |
2261 | 2278 | if (ts->UnicodeEmojiWidth < 1 || 2 < ts->UnicodeEmojiWidth) { |
2262 | - ts->UnicodeEmojiWidth = 1; | |
2279 | + ts->UnicodeEmojiWidth = GetDefaultUnicodeWidth(); | |
2263 | 2280 | } |
2264 | 2281 | |
2265 | 2282 | DispReadIni(FName, ts); |