diff --git a/apps/readest-app/public/locales/de/translation.json b/apps/readest-app/public/locales/de/translation.json index bfe0250b..81f76ba8 100644 --- a/apps/readest-app/public/locales/de/translation.json +++ b/apps/readest-app/public/locales/de/translation.json @@ -57,7 +57,6 @@ "Language:": "Sprache:", "Layout": "Layout", "Light Mode": "Hellmodus", - "Line Height": "Zeilenhöhe", "Loading...": "Wird geladen...", "Loc. {{currentPage}} / {{totalPage}}": "Pos. {{currentPage}} / {{totalPage}}", "Logged in": "Angemeldet", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Buch gelöscht: {{title}}", "Failed to delete book: {{title}}": "Fehler beim Löschen des Buches: {{title}}", "Check Updates on Start": "Aktualisierungen beim Start prüfen", - "Insufficient storage quota": "Unzureichendes Speicherkontingent" + "Insufficient storage quota": "Unzureichendes Speicherkontingent", + "Font Weight": "Schriftgewicht", + "Line Spacing": "Zeilenabstand", + "Word Spacing": "Wortabstand", + "Letter Spacing": "Buchstabenabstand", + "Text Indent": "Texteinzug", + "Paragraph Margin": "Absatzrand" } diff --git a/apps/readest-app/public/locales/el/translation.json b/apps/readest-app/public/locales/el/translation.json index c2eb4693..dca8fb37 100644 --- a/apps/readest-app/public/locales/el/translation.json +++ b/apps/readest-app/public/locales/el/translation.json @@ -57,7 +57,6 @@ "Language:": "Γλώσσα:", "Layout": "Διάταξη", "Light Mode": "Φωτεινή λειτουργία", - "Line Height": "Ύψος γραμμής", "Loading...": "Φόρτωση...", "Loc. {{currentPage}} / {{totalPage}}": "Θέση {{currentPage}} / {{totalPage}}", "Logged in": "Συνδεδεμένος", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Το βιβλίο με τίτλο {{title}} διαγράφηκε", "Failed to delete book: {{title}}": "Αποτυχία διαγραφής βιβλίου: {{title}}", "Check Updates on Start": "Έλεγχος ενημερώσεων κατά την εκκίνηση", - "Insufficient storage quota": "Ανεπαρκές όριο αποθήκευσης" + "Insufficient storage quota": "Ανεπαρκές όριο αποθήκευσης", + "Font Weight": "Βάρος γραμματοσειράς", + "Line Spacing": "Διάκενο γραμμών", + "Word Spacing": "Διάκενο λέξεων", + "Letter Spacing": "Διάκενο γραμμάτων", + "Text Indent": "Εσοχή κειμένου", + "Paragraph Margin": "Περιθώριο παραγράφου" } diff --git a/apps/readest-app/public/locales/es/translation.json b/apps/readest-app/public/locales/es/translation.json index ad4cacfb..9d035d93 100644 --- a/apps/readest-app/public/locales/es/translation.json +++ b/apps/readest-app/public/locales/es/translation.json @@ -57,7 +57,6 @@ "Language:": "Idioma:", "Layout": "Diseño", "Light Mode": "Modo claro", - "Line Height": "Altura de línea", "Loading...": "Cargando...", "Loc. {{currentPage}} / {{totalPage}}": "Pos. {{currentPage}} / {{totalPage}}", "Logged in": "Sesión iniciada", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Libro eliminado: {{title}}", "Failed to delete book: {{title}}": "Error al eliminar libro: {{title}}", "Check Updates on Start": "Comprobar actualizaciones al iniciar", - "Insufficient storage quota": "Cuota de almacenamiento insuficiente" + "Insufficient storage quota": "Cuota de almacenamiento insuficiente", + "Font Weight": "Peso de la fuente", + "Line Spacing": "Espaciado de línea", + "Word Spacing": "Espaciado de palabras", + "Letter Spacing": "Espaciado de letras", + "Text Indent": "Sangría de texto", + "Paragraph Margin": "Margen de párrafo" } diff --git a/apps/readest-app/public/locales/fr/translation.json b/apps/readest-app/public/locales/fr/translation.json index 6d697931..a6cb70dc 100644 --- a/apps/readest-app/public/locales/fr/translation.json +++ b/apps/readest-app/public/locales/fr/translation.json @@ -57,7 +57,6 @@ "Language:": "Langue :", "Layout": "Mise en page", "Light Mode": "Mode clair", - "Line Height": "Hauteur de ligne", "Loading...": "Chargement...", "Loc. {{currentPage}} / {{totalPage}}": "Pos. {{currentPage}} / {{totalPage}}", "Logged in": "Connecté", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Livre supprimé : {{title}}", "Failed to delete book: {{title}}": "Échec de la suppression du livre : {{title}}", "Check Updates on Start": "Vérifier les mises à jour au démarrage", - "Insufficient storage quota": "Quota de stockage insuffisant" + "Insufficient storage quota": "Quota de stockage insuffisant", + "Font Weight": "Poids de la police", + "Line Spacing": "Interligne", + "Word Spacing": "Espacement des mots", + "Letter Spacing": "Espacement des lettres", + "Text Indent": "Retrait du texte", + "Paragraph Margin": "Marge de paragraphe" } diff --git a/apps/readest-app/public/locales/hi/translation.json b/apps/readest-app/public/locales/hi/translation.json index d2f164e2..57e67af6 100644 --- a/apps/readest-app/public/locales/hi/translation.json +++ b/apps/readest-app/public/locales/hi/translation.json @@ -57,7 +57,6 @@ "Language:": "भाषा:", "Layout": "लेआउट", "Light Mode": "लाइट मोड", - "Line Height": "लाइन हाइट", "Loading...": "लोड हो रहा है...", "Loc. {{currentPage}} / {{totalPage}}": "स्थान {{currentPage}} / {{totalPage}}", "Logged in": "लॉग इन किया", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "पुस्तक हटाई गई: {{title}}", "Failed to delete book: {{title}}": "पुस्तक हटाने में विफल: {{title}}", "Check Updates on Start": "शुरू में अपडेट जांचें", - "Insufficient storage quota": "अपर्याप्त स्टोरेज कोटा" + "Insufficient storage quota": "अपर्याप्त स्टोरेज कोटा", + "Font Weight": "फ़ॉन्ट वजन", + "Line Spacing": "लाइन स्पेसिंग", + "Word Spacing": "शब्द स्पेसिंग", + "Letter Spacing": "अक्षर स्पेसिंग", + "Text Indent": "टेक्स्ट इंडेंट", + "Paragraph Margin": "पैराग्राफ मार्जिन" } diff --git a/apps/readest-app/public/locales/id/translation.json b/apps/readest-app/public/locales/id/translation.json index afd7c2aa..afcece05 100644 --- a/apps/readest-app/public/locales/id/translation.json +++ b/apps/readest-app/public/locales/id/translation.json @@ -57,7 +57,6 @@ "Language:": "Bahasa:", "Layout": "Tata Letak", "Light Mode": "Mode Terang", - "Line Height": "Tinggi Baris", "Loading...": "Memuat...", "Loc. {{currentPage}} / {{totalPage}}": "Lok. {{currentPage}} / {{totalPage}}", "Logged in": "Sudah Masuk", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Buku dihapus: {{title}}", "Failed to delete book: {{title}}": "Gagal menghapus buku: {{title}}", "Check Updates on Start": "Periksa Pembaruan saat Memulai", - "Insufficient storage quota": "Kuota penyimpanan tidak mencukupi" + "Insufficient storage quota": "Kuota penyimpanan tidak mencukupi", + "Font Weight": "Berat Font", + "Line Spacing": "Spasi Baris", + "Word Spacing": "Spasi Kata", + "Letter Spacing": "Spasi Huruf", + "Text Indent": "Indentasi Teks", + "Paragraph Margin": "Margin Paragraf" } diff --git a/apps/readest-app/public/locales/it/translation.json b/apps/readest-app/public/locales/it/translation.json index 332f78f7..30156674 100644 --- a/apps/readest-app/public/locales/it/translation.json +++ b/apps/readest-app/public/locales/it/translation.json @@ -57,7 +57,6 @@ "Language:": "Lingua:", "Layout": "Layout", "Light Mode": "Modalità chiara", - "Line Height": "Altezza riga", "Loading...": "Caricamento...", "Loc. {{currentPage}} / {{totalPage}}": "Pos. {{currentPage}} / {{totalPage}}", "Logged in": "Accesso effettuato", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Libro eliminato: {{title}}", "Failed to delete book: {{title}}": "Eliminazione libro non riuscita: {{title}}", "Check Updates on Start": "Controlla aggiornamenti all'avvio", - "Insufficient storage quota": "Quota di archiviazione insufficiente" + "Insufficient storage quota": "Quota di archiviazione insufficiente", + "Font Weight": "Peso font", + "Line Spacing": "Interlinea", + "Word Spacing": "Spaziatura parole", + "Letter Spacing": "Spaziatura lettere", + "Text Indent": "Rientro testo", + "Paragraph Margin": "Margine paragrafo" } diff --git a/apps/readest-app/public/locales/ja/translation.json b/apps/readest-app/public/locales/ja/translation.json index becaa65a..6678207e 100644 --- a/apps/readest-app/public/locales/ja/translation.json +++ b/apps/readest-app/public/locales/ja/translation.json @@ -57,7 +57,6 @@ "Language:": "言語:", "Layout": "レイアウト", "Light Mode": "ライトモード", - "Line Height": "行間", "Loading...": "読み込み中...", "Loc. {{currentPage}} / {{totalPage}}": "位置 {{currentPage}} / {{totalPage}}", "Logged in": "ログイン済み", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "書籍が削除されました:{{title}}", "Failed to delete book: {{title}}": "書籍の削除に失敗しました:{{title}}", "Check Updates on Start": "開始時に更新を確認", - "Insufficient storage quota": "ストレージクォータが不足しています" + "Insufficient storage quota": "ストレージクォータが不足しています", + "Font Weight": "フォントウェイト", + "Line Spacing": "行間", + "Word Spacing": "単語間隔", + "Letter Spacing": "文字間隔", + "Text Indent": "テキストインデント", + "Paragraph Margin": "段落マージン" } diff --git a/apps/readest-app/public/locales/ko/translation.json b/apps/readest-app/public/locales/ko/translation.json index b49b9116..528530ef 100644 --- a/apps/readest-app/public/locales/ko/translation.json +++ b/apps/readest-app/public/locales/ko/translation.json @@ -57,7 +57,6 @@ "Language:": "언어:", "Layout": "레이아웃", "Light Mode": "라이트 모드", - "Line Height": "줄 간격", "Loading...": "로딩 중...", "Loc. {{currentPage}} / {{totalPage}}": "위치 {{currentPage}} / {{totalPage}}", "Logged in": "로그인됨", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "책 삭제됨: {{title}}", "Failed to delete book: {{title}}": "책 삭제 실패: {{title}}", "Check Updates on Start": "시작 시 업데이트 확인", - "Insufficient storage quota": "저장소 할당량 부족" + "Insufficient storage quota": "저장소 할당량 부족", + "Font Weight": "글꼴 두께", + "Line Spacing": "줄 간격", + "Word Spacing": "단어 간격", + "Letter Spacing": "글자 간격", + "Text Indent": "들여쓰기", + "Paragraph Margin": "단락 여백" } diff --git a/apps/readest-app/public/locales/pl/translation.json b/apps/readest-app/public/locales/pl/translation.json index dec71672..21560d71 100644 --- a/apps/readest-app/public/locales/pl/translation.json +++ b/apps/readest-app/public/locales/pl/translation.json @@ -57,7 +57,6 @@ "Language:": "Język:", "Layout": "Układ", "Light Mode": "Tryb jasny", - "Line Height": "Wysokość linii", "Loading...": "Ładowanie...", "Loc. {{currentPage}} / {{totalPage}}": "Poz. {{currentPage}} / {{totalPage}}", "Logged in": "Zalogowano", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Książka usunięta: {{title}}", "Failed to delete book: {{title}}": "Nie udało się usunąć książki: {{title}}", "Check Updates on Start": "Sprawdź aktualizacje przy starcie", - "Insufficient storage quota": "Niewystarczająca kwota przechowywania" + "Insufficient storage quota": "Niewystarczająca kwota przechowywania", + "Font Weight": "Grubość czcionki", + "Line Spacing": "Interlinia", + "Word Spacing": "Odstęp między wyrazami", + "Letter Spacing": "Odstęp między literami", + "Text Indent": "Wcięcie tekstu", + "Paragraph Margin": "Margines akapitu" } diff --git a/apps/readest-app/public/locales/pt/translation.json b/apps/readest-app/public/locales/pt/translation.json index 7f6fe141..ea743b7e 100644 --- a/apps/readest-app/public/locales/pt/translation.json +++ b/apps/readest-app/public/locales/pt/translation.json @@ -57,7 +57,6 @@ "Language:": "Idioma:", "Layout": "Layout", "Light Mode": "Modo Claro", - "Line Height": "Altura da Linha", "Loading...": "Carregando...", "Loc. {{currentPage}} / {{totalPage}}": "Loc. {{currentPage}} / {{totalPage}}", "Logged in": "Conectado", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Livro excluído: {{title}}", "Failed to delete book: {{title}}": "Falha ao excluir livro: {{title}}", "Check Updates on Start": "Verificar Atualizações ao Iniciar", - "Insufficient storage quota": "Cota de armazenamento insuficiente" + "Insufficient storage quota": "Cota de armazenamento insuficiente", + "Font Weight": "Peso da Fonte", + "Line Spacing": "Espaçamento de Linha", + "Word Spacing": "Espaçamento de Palavra", + "Letter Spacing": "Espaçamento de Letra", + "Text Indent": "Recuo de Texto", + "Paragraph Margin": "Margem de Parágrafo" } diff --git a/apps/readest-app/public/locales/ru/translation.json b/apps/readest-app/public/locales/ru/translation.json index e0c21dd1..c0d9c538 100644 --- a/apps/readest-app/public/locales/ru/translation.json +++ b/apps/readest-app/public/locales/ru/translation.json @@ -57,7 +57,6 @@ "Language:": "Язык:", "Layout": "Макет", "Light Mode": "Светлая тема", - "Line Height": "Межстрочный интервал", "Loading...": "Загрузка...", "Loc. {{currentPage}} / {{totalPage}}": "Поз. {{currentPage}} / {{totalPage}}", "Logged in": "Выполнен вход", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Книга удалена: {{title}}", "Failed to delete book: {{title}}": "Не удалось удалить книгу: {{title}}", "Check Updates on Start": "Проверять обновления при запуске", - "Insufficient storage quota": "Недостаточно квоты хранилища" + "Insufficient storage quota": "Недостаточно квоты хранилища", + "Font Weight": "Насыщенность шрифта", + "Line Spacing": "Межстрочный интервал", + "Word Spacing": "Межсловный интервал", + "Letter Spacing": "Межбуквенный интервал", + "Text Indent": "Отступ текста", + "Paragraph Margin": "Отступ абзаца" } diff --git a/apps/readest-app/public/locales/tr/translation.json b/apps/readest-app/public/locales/tr/translation.json index 6ef4c736..78b8e794 100644 --- a/apps/readest-app/public/locales/tr/translation.json +++ b/apps/readest-app/public/locales/tr/translation.json @@ -57,7 +57,6 @@ "Language:": "Dil:", "Layout": "Düzen", "Light Mode": "Aydınlık Mod", - "Line Height": "Satır Yüksekliği", "Loading...": "Yükleniyor...", "Loc. {{currentPage}} / {{totalPage}}": "Konum {{currentPage}} / {{totalPage}}", "Logged in": "Giriş Yapıldı", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Kitap silindi: {{title}}", "Failed to delete book: {{title}}": "Kitap silinemedi: {{title}}", "Check Updates on Start": "Başlangıçta Güncellemeleri Kontrol Et", - "Insufficient storage quota": "Yetersiz depolama kotası" + "Insufficient storage quota": "Yetersiz depolama kotası", + "Font Weight": "Yazı Tipi Ağırlığı", + "Line Spacing": "Satır Aralığı", + "Word Spacing": "Kelime Aralığı", + "Letter Spacing": "Harf Aralığı", + "Text Indent": "Metin Girintisi", + "Paragraph Margin": "Paragraf Kenarı" } diff --git a/apps/readest-app/public/locales/uk/translation.json b/apps/readest-app/public/locales/uk/translation.json index 818355c3..19a99dc0 100644 --- a/apps/readest-app/public/locales/uk/translation.json +++ b/apps/readest-app/public/locales/uk/translation.json @@ -57,7 +57,6 @@ "Language:": "Мова:", "Layout": "Макет", "Light Mode": "Світлий режим", - "Line Height": "Висота рядка", "Loading...": "Завантаження...", "Loc. {{currentPage}} / {{totalPage}}": "Поз. {{currentPage}} / {{totalPage}}", "Logged in": "Увійшли", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Книгу видалено: {{title}}", "Failed to delete book: {{title}}": "Не вдалося видалити книгу: {{title}}", "Check Updates on Start": "Перевіряти оновлення при запуску", - "Insufficient storage quota": "Недостатньо квоти сховища" + "Insufficient storage quota": "Недостатньо квоти сховища", + "Font Weight": "Насиченість шрифту", + "Line Spacing": "Міжрядковий інтервал", + "Word Spacing": "Міжслівний інтервал", + "Letter Spacing": "Міжбуквений інтервал", + "Text Indent": "Відступ тексту", + "Paragraph Margin": "Відступ абзацу" } diff --git a/apps/readest-app/public/locales/vi/translation.json b/apps/readest-app/public/locales/vi/translation.json index 0392e387..88e1968c 100644 --- a/apps/readest-app/public/locales/vi/translation.json +++ b/apps/readest-app/public/locales/vi/translation.json @@ -57,7 +57,6 @@ "Language:": "Ngôn ngữ:", "Layout": "Bố cục", "Light Mode": "Chế độ sáng", - "Line Height": "Độ cao dòng", "Loading...": "Đang tải...", "Loc. {{currentPage}} / {{totalPage}}": "Vị trí {{currentPage}} / {{totalPage}}", "Logged in": "Đã đăng nhập", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "Sách đã xóa: {{title}}", "Failed to delete book: {{title}}": "Không thể xóa sách: {{title}}", "Check Updates on Start": "Kiểm tra cập nhật khi khởi động", - "Insufficient storage quota": "Không đủ lượng lưu trữ" + "Insufficient storage quota": "Không đủ lượng lưu trữ", + "Font Weight": "Độ đậm của phông chữ", + "Line Spacing": "Khoảng cách dòng", + "Word Spacing": "Khoảng cách từ", + "Letter Spacing": "Khoảng cách chữ", + "Text Indent": "Thụt lề", + "Paragraph Margin": "Lề đoạn" } diff --git a/apps/readest-app/public/locales/zh-CN/translation.json b/apps/readest-app/public/locales/zh-CN/translation.json index e14a7c43..f10747ed 100644 --- a/apps/readest-app/public/locales/zh-CN/translation.json +++ b/apps/readest-app/public/locales/zh-CN/translation.json @@ -57,7 +57,6 @@ "Language:": "语言", "Layout": "布局", "Light Mode": "浅色主题", - "Line Height": "行高", "Loading...": "加载中...", "Loc. {{currentPage}} / {{totalPage}}": "位置 {{currentPage}} / {{totalPage}}", "Logged in": "已登录", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "书籍已删除:{{title}}", "Failed to delete book: {{title}}": "删除书籍失败:{{title}}", "Check Updates on Start": "启动时检查更新", - "Insufficient storage quota": "云存储空间不足" + "Insufficient storage quota": "云存储空间不足", + "Font Weight": "字重", + "Line Spacing": "行间距", + "Word Spacing": "词间距", + "Letter Spacing": "字间距", + "Text Indent": "首行缩进", + "Paragraph Margin": "段间距" } diff --git a/apps/readest-app/public/locales/zh-TW/translation.json b/apps/readest-app/public/locales/zh-TW/translation.json index 138c50a1..57fe3c7b 100644 --- a/apps/readest-app/public/locales/zh-TW/translation.json +++ b/apps/readest-app/public/locales/zh-TW/translation.json @@ -57,7 +57,6 @@ "Language:": "語言", "Layout": "版面", "Light Mode": "淺色主題", - "Line Height": "行高", "Loading...": "載入中...", "Loc. {{currentPage}} / {{totalPage}}": "位置 {{currentPage}} / {{totalPage}}", "Logged in": "已登入", @@ -150,5 +149,11 @@ "Book deleted: {{title}}": "書籍已刪除:{{title}}", "Failed to delete book: {{title}}": "書籍刪除失敗:{{title}}", "Check Updates on Start": "啟動時檢查更新", - "Insufficient storage quota": "雲存儲空間不足" + "Insufficient storage quota": "雲存儲空間不足", + "Font Weight": "字重", + "Line Spacing": "行間距", + "Word Spacing": "字間距", + "Letter Spacing": "字間距", + "Text Indent": "首行縮進", + "Paragraph Margin": "段間距" } diff --git a/apps/readest-app/src/app/library/components/LibraryHeader.tsx b/apps/readest-app/src/app/library/components/LibraryHeader.tsx index 8b8389f2..2eaa2f97 100644 --- a/apps/readest-app/src/app/library/components/LibraryHeader.tsx +++ b/apps/readest-app/src/app/library/components/LibraryHeader.tsx @@ -53,7 +53,7 @@ const LibraryHeader: React.FC = ({ isTrafficLightVisible ? 'pl-16' : 'pl-2', )} > -
+
@@ -68,7 +68,7 @@ const LibraryHeader: React.FC = ({ 'border-none focus:outline-none focus:ring-0', )} /> -
+
= ({
-
+
void; onGetFontFamily: (option: string, family: string) => string; } @@ -25,7 +25,8 @@ const FontDropdown: React.FC = ({ const _ = useTranslation(); const iconSize16 = useResponsiveSize(16); const defaultIconSize = useDefaultIconSize(); - const selectedOption = options.find((option) => option.option === selected) || options[0]!; + const allOptions = [...options, ...(moreOptions ?? [])]; + const selectedOption = allOptions.find((option) => option.option === selected) ?? allOptions[0]!; return (
+
+

{_('Font Weight')}

+
+
+ +
+
+
+

{_('Font Family')}

diff --git a/apps/readest-app/src/app/reader/components/settings/LayoutPanel.tsx b/apps/readest-app/src/app/reader/components/settings/LayoutPanel.tsx index 3100151a..020637aa 100644 --- a/apps/readest-app/src/app/reader/components/settings/LayoutPanel.tsx +++ b/apps/readest-app/src/app/reader/components/settings/LayoutPanel.tsx @@ -22,7 +22,11 @@ const LayoutPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => { const viewSettings = getViewSettings(bookKey)!; const { themeCode } = useTheme(); + const [paragraphMargin, setParagraphMargin] = useState(viewSettings.paragraphMargin!); const [lineHeight, setLineHeight] = useState(viewSettings.lineHeight!); + const [wordSpacing, setWordSpacing] = useState(viewSettings.wordSpacing!); + const [letterSpacing, setLetterSpacing] = useState(viewSettings.letterSpacing!); + const [textIndent, setTextIndent] = useState(viewSettings.textIndent!); const [fullJustification, setFullJustification] = useState(viewSettings.fullJustification!); const [hyphenation, setHyphenation] = useState(viewSettings.hyphenation!); const [marginPx, setMarginPx] = useState(viewSettings.marginPx!); @@ -32,6 +36,17 @@ const LayoutPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => { const [maxBlockSize, setMaxBlockSize] = useState(viewSettings.maxBlockSize!); const [writingMode, setWritingMode] = useState(viewSettings.writingMode!); + useEffect(() => { + viewSettings.paragraphMargin = paragraphMargin; + setViewSettings(bookKey, viewSettings); + if (isFontLayoutSettingsGlobal) { + settings.globalViewSettings.paragraphMargin = paragraphMargin; + setSettings(settings); + } + view?.renderer.setStyles?.(getStyles(viewSettings, themeCode)); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [paragraphMargin]); + useEffect(() => { viewSettings.lineHeight = lineHeight; setViewSettings(bookKey, viewSettings); @@ -43,6 +58,39 @@ const LayoutPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => { // eslint-disable-next-line react-hooks/exhaustive-deps }, [lineHeight]); + useEffect(() => { + viewSettings.wordSpacing = wordSpacing; + setViewSettings(bookKey, viewSettings); + if (isFontLayoutSettingsGlobal) { + settings.globalViewSettings.wordSpacing = wordSpacing; + setSettings(settings); + } + view?.renderer.setStyles?.(getStyles(viewSettings, themeCode)); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [wordSpacing]); + + useEffect(() => { + viewSettings.letterSpacing = letterSpacing; + setViewSettings(bookKey, viewSettings); + if (isFontLayoutSettingsGlobal) { + settings.globalViewSettings.letterSpacing = letterSpacing; + setSettings(settings); + } + view?.renderer.setStyles?.(getStyles(viewSettings, themeCode)); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [letterSpacing]); + + useEffect(() => { + viewSettings.textIndent = textIndent; + setViewSettings(bookKey, viewSettings); + if (isFontLayoutSettingsGlobal) { + settings.globalViewSettings.textIndent = textIndent; + setSettings(settings); + } + view?.renderer.setStyles?.(getStyles(viewSettings, themeCode)); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [textIndent]); + useEffect(() => { viewSettings.fullJustification = fullJustification; setViewSettings(bookKey, viewSettings); @@ -188,13 +236,49 @@ const LayoutPanel: React.FC<{ bookKey: string }> = ({ bookKey }) => {
+ + + +
{_('Full Justification')} { const serifFonts = [serif, ...SERIF_FONTS.filter((font) => font !== serif), ...FALLBACK_FONTS]; @@ -34,6 +35,7 @@ const getFontStyles = ( html, body { font-family: var(${defaultFont.toLowerCase() === 'serif' ? '--serif' : '--sans-serif'}) ${overrideFont ? '!important' : ''}; font-size: ${fontSize}px !important; + font-weight: ${fontWeight}; } body * { font-family: revert ${overrideFont ? '!important' : ''}; @@ -92,7 +94,11 @@ const getAdditionalFontFaces = () => ` `; const getLayoutStyles = ( - spacing: number, + paragraphMargin: number, + lineSpacing: number, + wordSpacing: number, + letterSpacing: number, + textIndent: number, justify: boolean, hyphenate: boolean, zoomLevel: number, @@ -144,6 +150,7 @@ const getLayoutStyles = ( html, body { color: ${fg}; ${writingMode === 'auto' ? '' : `writing-mode: ${writingMode};`} + text-indent: ${textIndent}em; text-align: var(--default-text-align); background-color: var(--theme-bg-color, transparent); background: var(--background-set, none); @@ -160,7 +167,10 @@ const getLayoutStyles = ( background-color: transparent !important; } p, li, blockquote, dd { - line-height: ${spacing} !important; + margin: ${paragraphMargin}em 0 !important; + line-height: ${lineSpacing} !important; + word-spacing: ${wordSpacing}px !important; + letter-spacing: ${letterSpacing}px !important; text-align: inherit; -webkit-hyphens: ${hyphenate ? 'auto' : 'manual'}; hyphens: ${hyphenate ? 'auto' : 'manual'}; @@ -201,7 +211,11 @@ export interface ThemeCode { export const getStyles = (viewSettings: ViewSettings, themeCode: ThemeCode) => { const layoutStyles = getLayoutStyles( + viewSettings.paragraphMargin!, viewSettings.lineHeight!, + viewSettings.wordSpacing!, + viewSettings.letterSpacing!, + viewSettings.textIndent!, viewSettings.fullJustification!, viewSettings.hyphenation!, viewSettings.zoomLevel! / 100.0, @@ -219,6 +233,7 @@ export const getStyles = (viewSettings: ViewSettings, themeCode: ThemeCode) => { viewSettings.monospaceFont!, viewSettings.defaultFont!, viewSettings.defaultFontSize! * fontScale, + viewSettings.fontWeight!, viewSettings.overrideFont!, ); const userStylesheet = viewSettings.userStylesheet!;