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

add an experimental switch to disable font ligatures #2166

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,9 @@

## [Unreleased][unreleased]

### Added
- add experimental setting to disable font ligatures, see https://support.delta.chat/t/disabling-font-ligatures/1490

## [1.15.2] - 2021-03-03

### Fixed
Expand Down
3 changes: 3 additions & 0 deletions _locales/_untranslated_en.json
Expand Up @@ -64,5 +64,8 @@
},
"forwared_by": {
"message": "Forwarded by %1$s"
},
"pref_disable_fontligatures": {
"message": "Disable Font Ligatures (visually connected letters)"
}
}
5 changes: 5 additions & 0 deletions scss/_css_settings.scss
@@ -0,0 +1,5 @@
body.disable_font_ligatures {
* {
font-variant-ligatures: none;
}
}
2 changes: 2 additions & 0 deletions scss/manifest.scss
Expand Up @@ -75,3 +75,5 @@
@import '_offline-toast';

@import '_icons';

@import 'css_settings';
15 changes: 14 additions & 1 deletion src/renderer/App.tsx
Expand Up @@ -129,12 +129,23 @@ function SettingsContextWrapper({
}) {
const [desktopSettings, _setDesktopSettings] = useState<DesktopSettings>(null)

const applyCssSettings = (desktopSettings: DesktopSettings) => {
// apply disable Font Ligatures
const body = document.querySelector('body')
if (desktopSettings['disableFontLigatures']) {
body.classList.add('disable_font_ligatures')
} else {
body.classList.remove('disable_font_ligatures')
}
}

useEffect(() => {
;(async () => {
const desktopSettings = await DeltaBackend.call(
'settings.getDesktopSettings'
)
_setDesktopSettings(desktopSettings)
applyCssSettings(desktopSettings)
})()
}, [])

Expand All @@ -147,7 +158,9 @@ function SettingsContextWrapper({
true
) {
_setDesktopSettings((prevState: DesktopSettings) => {
return { ...prevState, [key]: value }
const newState = { ...prevState, [key]: value }
applyCssSettings(newState)
return newState
})
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/components/dialogs/Settings.tsx
Expand Up @@ -303,6 +303,10 @@ export default function Settings(props: DialogProps) {
</>
)}
<br />
{renderDTSettingSwitch(
'disableFontLigatures',
tx('pref_disable_fontligatures')
)}
<H5>{tx('pref_imap_folder_handling')}</H5>
{renderDeltaSwitch('inbox_watch', tx('pref_watch_inbox_folder'))}
{renderDeltaSwitch('sentbox_watch', tx('pref_watch_sent_folder'))}
Expand Down
1 change: 1 addition & 0 deletions src/shared/shared-types.d.ts
Expand Up @@ -42,6 +42,7 @@ export interface DesktopSettings {
/** adress to the active theme file scheme: "custom:name" or "dc:name" */
activeTheme: string
minimizeToTray: boolean
disableFontLigatures: boolean
}

export interface AppState {
Expand Down
1 change: 1 addition & 0 deletions src/shared/state.ts
Expand Up @@ -20,6 +20,7 @@ export function getDefaultState(): AppState {
zoomFactor: 1,
activeTheme: 'system',
minimizeToTray: false,
disableFontLigatures: false,
},
logins: [],
}
Expand Down