From be422aff9b866fdc02f7b1a15c591144ff8c43ed Mon Sep 17 00:00:00 2001 From: Takeo Hashimoto Date: Sun, 17 Mar 2024 15:21:48 +0900 Subject: [PATCH 1/4] allow negative value for VTFontSpace --- teraterm/ttpset/ttset.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/teraterm/ttpset/ttset.c b/teraterm/ttpset/ttset.c index 62afdd754..09e9cc64a 100644 --- a/teraterm/ttpset/ttset.c +++ b/teraterm/ttpset/ttset.c @@ -1462,15 +1462,19 @@ void PASCAL _ReadIniFile(const wchar_t *FName, PTTSet ts) GetNthNum(Temp, 2, &ts->FontDW); GetNthNum(Temp, 3, &ts->FontDY); GetNthNum(Temp, 4, &ts->FontDH); + /* if (ts->FontDX < 0) ts->FontDX = 0; if (ts->FontDW < 0) ts->FontDW = 0; + */ ts->FontDW = ts->FontDW + ts->FontDX; + /* if (ts->FontDY < 0) ts->FontDY = 0; if (ts->FontDH < 0) ts->FontDH = 0; + */ ts->FontDH = ts->FontDH + ts->FontDY; // VT-print scaling factors (pixels per inch) --- special option From b7525d04ebe68675ccdf0380f68d1128c62c7285 Mon Sep 17 00:00:00 2001 From: Takeo Hashimoto Date: Mon, 18 Mar 2024 02:50:55 +0900 Subject: [PATCH 2/4] add dialog handling --- teraterm/teraterm/font_pp.cpp | 31 +++++++++++++++++++++++++++---- teraterm/teraterm/font_pp.rc | 10 +++++----- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git a/teraterm/teraterm/font_pp.cpp b/teraterm/teraterm/font_pp.cpp index 608d43a33..ff88514ca 100644 --- a/teraterm/teraterm/font_pp.cpp +++ b/teraterm/teraterm/font_pp.cpp @@ -188,10 +188,10 @@ static INT_PTR CALLBACK Proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) CheckDlgButton(hWnd, IDC_LIST_HIDDEN_FONTS, ts->ListHiddenFonts); EnableWindow(GetDlgItem(hWnd, IDC_LIST_HIDDEN_FONTS), IsWindows7OrLater() ? TRUE : FALSE); - SetDlgItemInt(hWnd, IDC_SPACE_RIGHT, ts->FontDW, FALSE); - SetDlgItemInt(hWnd, IDC_SPACE_LEFT, ts->FontDH, FALSE); - SetDlgItemInt(hWnd, IDC_SPACE_TOP, ts->FontDX, FALSE); - SetDlgItemInt(hWnd, IDC_SPACE_BOTTOM, ts->FontDY, FALSE); + SetDlgItemInt(hWnd, IDC_SPACE_LEFT, ts->FontDX, TRUE); + SetDlgItemInt(hWnd, IDC_SPACE_RIGHT, ts->FontDW, TRUE); + SetDlgItemInt(hWnd, IDC_SPACE_TOP, ts->FontDY, TRUE); + SetDlgItemInt(hWnd, IDC_SPACE_BOTTOM, ts->FontDH, TRUE); SetFontString(hWnd, IDC_DLGFONT_EDIT, &dlg_data->DlgFont); @@ -215,6 +215,29 @@ static INT_PTR CALLBACK Proc(HWND hWnd, UINT msg, WPARAM wp, LPARAM lp) DispEnableResizedFont(IsDlgButtonChecked(hWnd, IDC_RESIZED_FONT) == BST_CHECKED); + BOOL parsed; + int dlgx, dlgw, dlgy, dlgh; + dlgx = GetDlgItemInt(hWnd, IDC_SPACE_LEFT, &parsed, TRUE); + if (parsed) { + dlgw = GetDlgItemInt(hWnd, IDC_SPACE_RIGHT, &parsed, TRUE); + if (parsed) { + dlgy = GetDlgItemInt(hWnd, IDC_SPACE_TOP, &parsed, TRUE); + if (parsed) { + dlgh = GetDlgItemInt(hWnd, IDC_SPACE_BOTTOM, &parsed, TRUE); + if (parsed) { + if (ts->FontDX != dlgx || ts->FontDW != dlgw || ts->FontDY != dlgy || ts->FontDH != dlgh) { + ts->FontDX = dlgx; + ts->FontDW = dlgw; + ts->FontDY = dlgy; + ts->FontDH = dlgh; + ChangeFont(); + DispChangeWinSize(ts->TerminalWidth, ts->TerminalHeight); + } + } + } + } + } + break; } case PSN_HELP: { diff --git a/teraterm/teraterm/font_pp.rc b/teraterm/teraterm/font_pp.rc index a0a735fc0..e5d9e4947 100644 --- a/teraterm/teraterm/font_pp.rc +++ b/teraterm/teraterm/font_pp.rc @@ -71,11 +71,11 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,181,234,10 CONTROL "List &proportional fonts in font dialog",IDC_LIST_PRO_FONTS, "Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,7,196,240,10 - LTEXT "character space",IDC_CHARACTER_SPACE_TITLE,187,51,115,8,WS_DISABLED - EDITTEXT IDC_SPACE_TOP,224,68,40,14,ES_AUTOHSCROLL | WS_DISABLED - EDITTEXT IDC_SPACE_BOTTOM,224,87,40,14,ES_AUTOHSCROLL | WS_DISABLED - EDITTEXT IDC_SPACE_LEFT,224,105,40,14,ES_AUTOHSCROLL | WS_DISABLED - EDITTEXT IDC_SPACE_RIGHT,224,123,40,14,ES_AUTOHSCROLL | WS_DISABLED + LTEXT "character space",IDC_CHARACTER_SPACE_TITLE,187,51,115,8 + EDITTEXT IDC_SPACE_TOP,208,74,40,14,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_SPACE_BOTTOM,208,123,40,14,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_SPACE_LEFT,176,98,40,14,ES_AUTOHSCROLL,WS_EX_RIGHT + EDITTEXT IDC_SPACE_RIGHT,242,98,40,14,ES_AUTOHSCROLL,WS_EX_RIGHT CONTROL "Drawing resized font to fit cell width",IDC_RESIZED_FONT, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,125,140,10 END From c06d7ce346d6b9ae225f1f4f9031ba65823c06ec Mon Sep 17 00:00:00 2001 From: Takeo Hashimoto Date: Wed, 20 Mar 2024 23:37:53 +0900 Subject: [PATCH 3/4] update documents. --- doc/en/html/about/history.html | 1 + doc/en/html/setup/teraterm-win.html | 5 +++-- doc/ja/html/about/history.html | 1 + doc/ja/html/setup/teraterm-win.html | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/en/html/about/history.html b/doc/en/html/about/history.html index 04da9af86..4e5e2bf2c 100644 --- a/doc/en/html/about/history.html +++ b/doc/en/html/about/history.html @@ -39,6 +39,7 @@

YYYY.MM.DD (Ver 5.3 not released yet)

  • MACRO: When TTL file is relative path, it is relative from current directory of ttpmacro.
  • Use EnableContinuedLineCopy setting when dragging after selecting a word by double click.
  • Show error messagebox when logging cannot be started with LogAutoStart=on
  • +
  • VTFontSpace can be used to adjust to narrow the space between characters.
  • diff --git a/doc/en/html/setup/teraterm-win.html b/doc/en/html/setup/teraterm-win.html index 78bd198c1..5c914db0f 100644 --- a/doc/en/html/setup/teraterm-win.html +++ b/doc/en/html/setup/teraterm-win.html @@ -317,8 +317,9 @@

    Space between characters (lines)

     Example:
    -VTFontSpace=0,1,0,0    1 pixel of right side space for each character.
    -VTFontSpace=0,0,1,0    1 pixel of space above each line.
    +VTFontSpace=0,1,0,0    expand 1 pixel of right side space for each character.
    +VTFontSpace=0,0,1,0    expand 1 pixel of space above each line.
    +VTFontSpace=0,0,-1,-1  reduce 1 pixel of space above and bellow each line.
     
    diff --git a/doc/ja/html/about/history.html b/doc/ja/html/about/history.html
    index 8bb25eef8..a5c351aae 100644
    --- a/doc/ja/html/about/history.html
    +++ b/doc/ja/html/about/history.html
    @@ -39,6 +39,7 @@ 

    YYYY.MM.DD (Ver 5.3 not released yet)

  • MACRO: TTLファイルを相対パスで指定したとき、ttpmacroのカレントディレクトリ相対で扱うようにした。
  • ダブルクリックでワード選択後のドラッグ時、EnableContinuedLineCopy を反映してするようにした。
  • LogAutoStart=on でログ記録が開始できないとき、エラーメッセージを表示するようにした。
  • +
  • VTFontSpace で負の値を設定できるようにした。
  • diff --git a/doc/ja/html/setup/teraterm-win.html b/doc/ja/html/setup/teraterm-win.html index e7c7e88a3..056306602 100644 --- a/doc/ja/html/setup/teraterm-win.html +++ b/doc/ja/html/setup/teraterm-win.html @@ -313,10 +313,10 @@
    -

    文字(行)間にすきまをあける

    +

    文字(行)間のすきまを調整する

    -文字(行)間にすきまをあけるには、設定ファイルの [Tera Term] セクションの VTFontSpace 行を以下のように変更してください。 +文字(行)間のすきまを調整するには、設定ファイルの [Tera Term] セクションの VTFontSpace 行を以下のように変更してください。

    @@ -336,6 +336,7 @@
     例:
     VTFontSpace=0,1,0,0    各文字の右側に1画素分のすきまをあける。
     VTFontSpace=0,0,1,0    各行の上側に1画素分のすきまをあける。
    +VTFontSpace=0,0,-1,-1  各行の上下を1画素分狭める。
     
    
    From 1084d248a89165fb10be043121ad26b106f30563 Mon Sep 17 00:00:00 2001
    From: Takeo Hashimoto 
    Date: Wed, 20 Mar 2024 23:48:04 +0900
    Subject: [PATCH 4/4] update documents.
    
    ---
     doc/ja/html/setup/teraterm.html | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/doc/ja/html/setup/teraterm.html b/doc/ja/html/setup/teraterm.html
    index e5e649978..90e9e3b4d 100644
    --- a/doc/ja/html/setup/teraterm.html
    +++ b/doc/ja/html/setup/teraterm.html
    @@ -69,7 +69,7 @@
      
  • マウスでウィンドウを選択したときの文字の選択を禁止する
  • タイトルの形式
  • 白色および黒色属性の文字の実際の色
  • -
  • 文字(行)間にすきまをあける
  • +
  • 文字(行)間のすきまを調整する
  • [Window] メニューを隠す
  • ウィンドウ最大化時のスクロール方法
  • フォーカスが外れた時にもカーソルを表示する