• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision10042 (tree)
Zeit2022-07-06 23:11:33
Autorzmatsuo

Log Message

Unicode文字幅の初期値をOSの言語から決定するようにした

- 次の文字幅の初期値(TERATERM.INIに未設定時)

- Ambiguous Characters width
- Unicode Emoji width

- 従来は1固定だった
- japanese(日本語)、Korean、Chinaの場合は 2 とするようにした
- Tera Term 4 からiniファイルを移行した場合でも違和感なく使えるよう考慮

ticket #45006

Ändern Zusammenfassung

Diff

--- trunk/teraterm/ttpset/ttset.c (revision 10041)
+++ trunk/teraterm/ttpset/ttset.c (revision 10042)
@@ -764,6 +764,23 @@
764764 ts->EtermLookfeel.BGNoFrame);
765765 }
766766
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+
767784 void PASCAL ReadIniFile(const wchar_t *FName, PTTSet ts)
768785 {
769786 int i;
@@ -2252,14 +2269,14 @@
22522269 &ts->DialogFontPoint, &ts->DialogFontCharSet);
22532270
22542271 // Unicode設定
2255- ts->UnicodeAmbiguousWidth = GetPrivateProfileInt(Section, "UnicodeAmbiguousWidth", 1, FName);
2272+ ts->UnicodeAmbiguousWidth = GetPrivateProfileInt(Section, "UnicodeAmbiguousWidth", 0, FName);
22562273 if (ts->UnicodeAmbiguousWidth < 1 || 2 < ts->UnicodeAmbiguousWidth) {
2257- ts->UnicodeAmbiguousWidth = 1;
2274+ ts->UnicodeAmbiguousWidth = GetDefaultUnicodeWidth();
22582275 }
22592276 ts->UnicodeEmojiOverride = (BYTE)GetOnOff(Section, "UnicodeEmojiOverride", FName, FALSE);
2260- ts->UnicodeEmojiWidth = GetPrivateProfileInt(Section, "UnicodeEmojiWidth", 1, FName);
2277+ ts->UnicodeEmojiWidth = GetPrivateProfileInt(Section, "UnicodeEmojiWidth", 0, FName);
22612278 if (ts->UnicodeEmojiWidth < 1 || 2 < ts->UnicodeEmojiWidth) {
2262- ts->UnicodeEmojiWidth = 1;
2279+ ts->UnicodeEmojiWidth = GetDefaultUnicodeWidth();
22632280 }
22642281
22652282 DispReadIni(FName, ts);
Show on old repository browser