From a8172fb3f9d49b03c58703651166234e79613703 Mon Sep 17 00:00:00 2001 From: Faizan Zafar Date: Mon, 3 Jun 2024 20:25:11 -0700 Subject: [PATCH 1/2] Update font settings in EpubReader and Reader components to include a "Font Boldness" slider which applies a stroke to the text #3020 on main repo --- components/readers/EpubReader.vue | 6 ++++-- components/readers/Reader.vue | 11 +++++++++-- strings/en-us.json | 3 ++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/components/readers/EpubReader.vue b/components/readers/EpubReader.vue index 75176f8e..813b64e7 100644 --- a/components/readers/EpubReader.vue +++ b/components/readers/EpubReader.vue @@ -38,7 +38,8 @@ export default { ereaderSettings: { theme: 'dark', fontScale: 100, - lineSpacing: 115 + lineSpacing: 115, + textStroke: 0 } } }, @@ -113,7 +114,8 @@ export default { '*': { color: `${fontColor}!important`, 'background-color': `${backgroundColor}!important`, - 'line-height': this.ereaderSettings.lineSpacing + '%!important' + 'line-height': this.ereaderSettings.lineSpacing + '%!important', + '-webkit-text-stroke': this.ereaderSettings.textStroke/100 + 'px ' + fontColor + '!important' }, a: { color: `${fontColor}!important` diff --git a/components/readers/Reader.vue b/components/readers/Reader.vue index ddd2d7bf..fb6ce969 100644 --- a/components/readers/Reader.vue +++ b/components/readers/Reader.vue @@ -82,6 +82,12 @@ +
+
+

{{ $strings.LabelFontBoldness }}:

+
+ +

{{ $strings.LabelLayout }}:

@@ -116,7 +122,8 @@ export default { theme: 'dark', fontScale: 100, lineSpacing: 115, - spread: 'auto' + spread: 'auto', + textStroke: 0 } } }, @@ -396,4 +403,4 @@ export default { this.unregisterListeners() } } - \ No newline at end of file + diff --git a/strings/en-us.json b/strings/en-us.json index c1de9cef..e2abd497 100644 --- a/strings/en-us.json +++ b/strings/en-us.json @@ -137,6 +137,7 @@ "LabelFilename": "Filename", "LabelFinished": "Finished", "LabelFolder": "Folder", + "LabelFontBoldness": "Font Boldness", "LabelFontScale": "Font scale", "LabelGenre": "Genre", "LabelGenres": "Genres", @@ -293,4 +294,4 @@ "ToastPodcastCreateSuccess": "Podcast created successfully", "ToastRSSFeedCloseFailed": "Failed to close RSS feed", "ToastRSSFeedCloseSuccess": "RSS feed closed" -} \ No newline at end of file +} From eb2aa6f7732d9c68783952ec72f912a0fa7dd894 Mon Sep 17 00:00:00 2001 From: advplyr Date: Mon, 10 Jun 2024 16:38:29 -0500 Subject: [PATCH 2/2] Map locally stored ebook settings onto defaults --- components/readers/Reader.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/readers/Reader.vue b/components/readers/Reader.vue index fb6ce969..7355bf3d 100644 --- a/components/readers/Reader.vue +++ b/components/readers/Reader.vue @@ -376,12 +376,12 @@ export default { try { const settings = localStorage.getItem('ereaderSettings') if (settings) { - const ereaderSettings = JSON.parse(settings) - if (!ereaderSettings.spread) { - // Added in 0.9.71 - ereaderSettings.spread = 'auto' + const _ereaderSettings = JSON.parse(settings) + for (const key in this.ereaderSettings) { + if (_ereaderSettings[key] !== undefined) { + this.ereaderSettings[key] = _ereaderSettings[key] + } } - this.ereaderSettings = ereaderSettings this.settingsUpdated() } } catch (error) {