From 903b7d70f939df984bcbf9ef3bc87fbaf6e11f4c Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Fri, 15 Apr 2022 18:47:55 +0200 Subject: [PATCH] alllow changing font weight for normal and bold text - fixes #3129, fixes #3400, fixes #5444, fixes #3045, fixes #6099 --- .../appearanceSettingsTab.component.pug | 24 ++++++++++++++ .../colorSchemePreview.component.pug | 32 +++++++++++++++---- tabby-terminal/src/config.ts | 2 ++ 3 files changed, 52 insertions(+), 6 deletions(-) diff --git a/tabby-terminal/src/components/appearanceSettingsTab.component.pug b/tabby-terminal/src/components/appearanceSettingsTab.component.pug index 83c9d5b5..71d3fbe5 100644 --- a/tabby-terminal/src/components/appearanceSettingsTab.component.pug +++ b/tabby-terminal/src/components/appearanceSettingsTab.component.pug @@ -28,6 +28,30 @@ h3.mb-3(translate) Appearance (ngModelChange)='config.save()', ) + .form-line + .header + .title(translate) Normal font weight + input.form-control( + type='number', + min='100', + max='900', + step='100', + [(ngModel)]='config.store.terminal.fontWeight', + (ngModelChange)='config.save()' + ) + + .form-line + .header + .title(translate) Bold font weight + input.form-control( + type='number', + min='100', + max='900', + step='100', + [(ngModel)]='config.store.terminal.fontWeightBold', + (ngModelChange)='config.save()' + ) + .col-12.col-md-6 color-scheme-preview([scheme]='config.store.terminal.colorScheme', [fontPreview]='true') diff --git a/tabby-terminal/src/components/colorSchemePreview.component.pug b/tabby-terminal/src/components/colorSchemePreview.component.pug index c77321bb..04e4e921 100644 --- a/tabby-terminal/src/components/colorSchemePreview.component.pug +++ b/tabby-terminal/src/components/colorSchemePreview.component.pug @@ -1,6 +1,7 @@ .preview( [style.font-family]='getPreviewFontFamily()', [style.font-size]='(fontPreview ? config.store.terminal.fontSize : 11) + "px"', + [style.font-weight]='config.store.terminal.fontWeight', [style.background-color]='scheme.background', [style.color]='scheme.foreground', [style.font-feature-settings]='\'"liga" \' + config.store.terminal.ligatures ? 1 : 0', @@ -10,21 +11,38 @@ span([style.color]='scheme.colors[2]') john span([style.color]='scheme.colors[6]') @ span([style.color]='scheme.colors[4]') doe-pc - strong([style.color]='scheme.colors[1]') $ + strong( + [style.color]='scheme.colors[1]', + [style.font-weight]='config.store.terminal.fontWeightBold' + ) $ span ls span([style.background-color]='scheme.cursor')   div span -rwxr-xr-x 1 root - strong([style.color]='scheme.colors[3]') Documents + strong( + [style.color]='scheme.colors[3]', + [style.font-weight]='config.store.terminal.fontWeightBold' + ) Documents div span -rwxr-xr-x 1 root  - strong([style.color]='scheme.colors[0]', [style.background]='scheme.colors[2]') Downloads + strong( + [style.color]='scheme.colors[0]', + [style.background]='scheme.colors[2]', + [style.font-weight]='config.store.terminal.fontWeightBold' + ) Downloads div span -rwxr-xr-x 1 root  - strong([style.color]='scheme.colors[0]', [style.background]='scheme.colors[8]') Pictures + strong( + [style.color]='scheme.colors[0]', + [style.background]='scheme.colors[8]', + [style.font-weight]='config.store.terminal.fontWeightBold' + ) Pictures div span -rwxr-xr-x 1 root - strong([style.color]='scheme.colors[12]') Music + strong( + [style.color]='scheme.colors[12]', + [style.font-weight]='config.store.terminal.fontWeightBold' + ) Music div(*ngIf='fontPreview') span -rwxr-xr-x 1 root span([style.color]='scheme.colors[2]') 実行可能ファイル @@ -35,7 +53,9 @@ span([style.color]='scheme.colors[1]') link div(*ngIf='fontPreview') span - strong Icons: + strong( + [style.font-weight]='config.store.terminal.fontWeightBold' + ) Icons: span    span span   diff --git a/tabby-terminal/src/config.ts b/tabby-terminal/src/config.ts index 99270715..8a7852b6 100644 --- a/tabby-terminal/src/config.ts +++ b/tabby-terminal/src/config.ts @@ -10,6 +10,8 @@ export class TerminalConfigProvider extends ConfigProvider { terminal: { frontend: 'xterm', fontSize: 14, + fontWeight: 400, + fontWeightBold: 700, fallbackFont: null, linePadding: 0, bell: 'off',