Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow negative value for VTFontSpace #171

Merged
merged 7 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/en/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
<li>Show error messagebox when logging cannot be started with LogAutoStart=on</li>
<li>Right-click(paste) is not disabled even when <a href="../setup/teraterm-win.html#textselect">SelectOnActivate</a> is off.</li>
<li>allow users to select creating automatic backup or not by <a href="../setup/teraterm-misc.html#IniAutoBackup">IniAutoBackup</a> when overwriting the ini file.
<li><a href="../setup/teraterm-win.html#space">VTFontSpace</a> can be used to adjust to narrow the space between characters.
</ul>
</li>

Expand Down
5 changes: 3 additions & 2 deletions doc/en/html/setup/teraterm-win.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,9 @@ <h1 id="space">Space between characters (lines)</h1>

<pre>
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.
</pre>

<pre>
Expand Down
1 change: 1 addition & 0 deletions doc/ja/html/about/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ <h3 id="teraterm_5.3">YYYY.MM.DD (Ver 5.3 not released yet)</h3>
<li>LogAutoStart=on �Ń��O�L�^���J�n�ł��Ȃ��Ƃ��A�G���[���b�Z�[�W��\������悤�ɂ����B</li>
<li><a href="../setup/teraterm-win.html#textselect">SelectOnActivate</a> �� off �ł��E�N���b�N�ɂ��\��t���͍s����悤�ɂ����B</li>
<li>ini�t�@�C�����㏑������ۂɎ����o�b�N�A�b�v���쐬���邩�ǂ����� <a href="../setup/teraterm-misc.html#IniAutoBackup">IniAutoBackup</a> �Őݒ�ł���悤�ɂ����B</li>
<li><a href="../setup/teraterm-win.html#space">VTFontSpace</a> �ŕ��̒l��ݒ�ł���悤�ɂ����B</li>
</ul>
</li>

Expand Down
5 changes: 3 additions & 2 deletions doc/ja/html/setup/teraterm-win.html
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,10 @@
</pre>


<h1 id="space">����(�s)�Ԃɂ����܂�������</h1>
<h1 id="space">����(�s)�Ԃ̂����܂𒲐�����</h1>

<p>
����(�s)�Ԃɂ����܂�������ɂ́A�ݒ�t�@�C���� [Tera Term] �Z�N�V������ VTFontSpace �s���ȉ��̂悤�ɕύX���Ă��������B
����(�s)�Ԃ̂����܂𒲐�����ɂ́A�ݒ�t�@�C���� [Tera Term] �Z�N�V������ VTFontSpace �s���ȉ��̂悤�ɕύX���Ă��������B
</p>

<pre>
Expand All @@ -336,6 +336,7 @@
��:
VTFontSpace=0,1,0,0 �e�����̉E����1��f���̂����܂�������B
VTFontSpace=0,0,1,0 �e�s�̏㑤��1��f���̂����܂�������B
VTFontSpace=0,0,-1,-1 �e�s�̏㉺��1��f�����߂�B
</pre>

<pre>
Expand Down
2 changes: 1 addition & 1 deletion doc/ja/html/setup/teraterm.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<li><a href="teraterm-win.html#textselect">�}�E�X�ŃE�B���h�E��I�������Ƃ��̕����̑I�����֎~����</a></li>
<li><a href="teraterm-win.html#title">�^�C�g���̌`��</a></li>
<li><a href="teraterm-win.html#color">���F����э��F�����̕����̎��ۂ̐F</a></li>
<li><a href="teraterm-win.html#space">����(�s)�Ԃɂ����܂�������</a></li>
<li><a href="teraterm-win.html#space">����(�s)�Ԃ̂����܂𒲐�����</a></li>
<li><a href="teraterm-win.html#window">[Window] ���j���[���B��</a></li>
<li><a href="teraterm-win.html#maximize">�E�B���h�E�ő剻���̃X�N���[�����@</a></li>
<li><a href="teraterm-win.html#killfocus">�t�H�[�J�X���O�ꂽ���ɂ��J�[�\����\������</a></li>
Expand Down
31 changes: 27 additions & 4 deletions teraterm/teraterm/font_pp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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: {
Expand Down
10 changes: 5 additions & 5 deletions teraterm/teraterm/font_pp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions teraterm/ttpset/ttset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down