[Ttssh2-commit] [7723] フォント情報(LOGFONT)生成時DPI取得共通関数を使用、フォントサイズ計算修正

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2019年 6月 1日 (土) 01:13:10 JST


Revision: 7723
          https://osdn.net/projects/ttssh2/scm/svn/commits/7723
Author:   zmatsuo
Date:     2019-06-01 01:13:10 +0900 (Sat, 01 Jun 2019)
Log Message:
-----------
フォント情報(LOGFONT)生成時DPI取得共通関数を使用、フォントサイズ計算修正

- SetLogFont()のDPI取得部をGetMonitorDpiFromWindow()に置換

Modified Paths:
--------------
    trunk/teraterm/teraterm/vtdisp.c

-------------- next part --------------
Modified: trunk/teraterm/teraterm/vtdisp.c
===================================================================
--- trunk/teraterm/teraterm/vtdisp.c	2019-05-31 16:13:00 UTC (rev 7722)
+++ trunk/teraterm/teraterm/vtdisp.c	2019-05-31 16:13:10 UTC (rev 7723)
@@ -1954,20 +1954,11 @@
   VTlf->lfQuality       = (BYTE)ts.FontQuality;
   VTlf->lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
   strncpy_s(VTlf->lfFaceName, sizeof(VTlf->lfFaceName),ts.VTFont, _TRUNCATE);
-#if 1
   if (mul) {
-	  UINT uDpi;
-	  if (pGetDpiForWindow == NULL) {
-		  HDC TmpDC = GetDC(HVTWin);
-		  uDpi = GetDeviceCaps(TmpDC,LOGPIXELSY);	// \x82\xA2\x82‚\xE096\x82\xF0\x95Ԃ\xB7?
-		  ReleaseDC(HVTWin,TmpDC);
-	  } else {
-		  uDpi = pGetDpiForWindow(HVTWin);
-	  }
-	  VTlf->lfWidth = -MulDiv(VTlf->lfWidth, uDpi, 96);
-	  VTlf->lfHeight = -MulDiv(VTlf->lfHeight, uDpi, 96);
+	  const UINT uDpi = GetMonitorDpiFromWindow(HVTWin);
+	  VTlf->lfWidth = MulDiv(VTlf->lfWidth, uDpi, 96);
+	  VTlf->lfHeight = MulDiv(VTlf->lfHeight, uDpi, 96);
   }
-#endif
 }
 
 void ChangeFont()


Ttssh2-commit メーリングリストの案内
Back to archive index