• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision7588 (tree)
Time2019-04-13 01:19:30
Authorzmatsuo

Log Message

ダイアログフォントのサイズ指定を誤っていたので修正

Change Summary

Incremental Difference

--- trunk/teraterm/common/dlglib_tmpl.cpp (revision 7587)
+++ trunk/teraterm/common/dlglib_tmpl.cpp (revision 7588)
@@ -446,6 +446,7 @@
446446 */
447447 void TTSetDlgFontW(const wchar_t *face, int height, int charset)
448448 {
449+ assert(height > 0);
449450 if (face != NULL) {
450451 wcscpy_s(FontFaceName, face);
451452 } else {
@@ -461,6 +462,7 @@
461462 */
462463 void TTSetDlgFontA(const char *face, int height, int charset)
463464 {
465+ assert(height > 0);
464466 if (face != NULL) {
465467 MultiByteToWideChar(CP_ACP, 0, face, -1, FontFaceName, LF_FACESIZE);
466468 } else {
--- trunk/teraterm/teraterm/vtwin.cpp (revision 7587)
+++ trunk/teraterm/teraterm/vtwin.cpp (revision 7588)
@@ -4694,9 +4694,14 @@
46944694 LOGFONTA LogFont;
46954695 CHOOSEFONTA cf;
46964696 BOOL result;
4697+
4698+ // LogFont.lfHeight は point
46974699 result = GetI18nLogfont("Tera Term", "DlgFont", &LogFont, 0, ts.SetupFName);
4698- if (result == FALSE) {
4699- memset(&LogFont, 0, sizeof(LogFont));
4700+ if (result == TRUE) {
4701+ // pixelに変換
4702+ LogFont.lfHeight = -GetFontPixelFromPoint(m_hWnd, LogFont.lfHeight);
4703+ } else {
4704+ GetMessageboxFont(&LogFont);
47004705 }
47014706
47024707 memset(&cf, 0, sizeof(cf));
@@ -4717,8 +4722,11 @@
47174722 result = ChooseFontA(&cf);
47184723 if (result) {
47194724 char Temp[80];
4725+ int font_point = cf.iPointSize / 10; // point で保存する
47204726 _snprintf_s(Temp, sizeof(Temp), _TRUNCATE, "%s,%d,%d",
4721- LogFont.lfFaceName, LogFont.lfHeight, LogFont.lfCharSet);
4727+ LogFont.lfFaceName,
4728+ font_point,
4729+ LogFont.lfCharSet);
47224730 WritePrivateProfileStringA("Tera Term", "DlgFont", Temp, ts.SetupFName);
47234731
47244732 SetDialogFont(ts.SetupFName, ts.UILanguageFile, "TTSSH");
Show on old repository browser