Skip to content

Disable EPUB pagination with vertical text #517

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

Merged
merged 1 commit into from
May 15, 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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file. Take a look

**Warning:** Features marked as *experimental* may change or be removed in a future release without notice. Use with caution.

<!-- ## [Unreleased] -->
## [Unreleased]

### Changed

#### Navigator

* EPUB: The `scroll` preference is now forced to `true` when rendering vertical text (e.g. CJK vertical). [See this discussion for the rationale](https://github.com/readium/swift-toolkit/discussions/370).


## [3.0.0-beta.1]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ public class EpubPreferencesEditor internal constructor(
PreferenceDelegate(
getValue = { preferences.scroll },
getEffectiveValue = { state.settings.scroll },
getIsEffective = { layout == EpubLayout.REFLOWABLE },
getIsEffective = { layout == EpubLayout.REFLOWABLE && !state.settings.verticalText },
updateValue = { value -> updateValues { it.copy(scroll = value) } }
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ internal class EpubSettingsResolver(

val theme = preferences.theme ?: Theme.LIGHT

var scroll = preferences.scroll ?: defaults.scroll ?: false

// / We disable pagination with vertical text, because CSS columns don't support it properly.
// / See https://github.com/readium/swift-toolkit/discussions/370
if (verticalText) {
scroll = true
}

return EpubSettings(
backgroundColor = preferences.backgroundColor,
columnCount = preferences.columnCount ?: defaults.columnCount ?: ColumnCount.AUTO,
Expand All @@ -45,7 +53,7 @@ internal class EpubSettingsResolver(
paragraphSpacing = preferences.paragraphSpacing ?: defaults.paragraphSpacing,
publisherStyles = preferences.publisherStyles ?: defaults.publisherStyles ?: true,
readingProgression = readingProgression,
scroll = preferences.scroll ?: defaults.scroll ?: false,
scroll = scroll,
spread = preferences.spread ?: defaults.spread ?: Spread.NEVER,
textAlign = preferences.textAlign ?: defaults.textAlign,
textColor = preferences.textColor,
Expand Down
Loading