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

Alignment of ruby text is affected by -epub-text-align-last #11771

Closed
yuanshuai0217 opened this issue May 8, 2024 · 1 comment · Fixed by #11863
Closed

Alignment of ruby text is affected by -epub-text-align-last #11771

yuanshuai0217 opened this issue May 8, 2024 · 1 comment · Fixed by #11863
Labels
Milestone

Comments

@yuanshuai0217
Copy link

  • KOReader version: 2024.04
  • Device: moaan mix7 (with Android 11)

Issue

The alignment of ruby text is affected by -epub-text-align-last, which is not preferred, as according to JLREQ, ruby text shall be always center-aligned.

Steps to reproduce

This is a MWE file: test_ruby.zip

Ruby text get left aligned, which should be centered instead:

Reader_2024-05-08_134025_proc

Deleting -epub-text-align-last: left from CSS can make it return to normal.

@poire-z
Copy link
Contributor

poire-z commented May 8, 2024

I probably forgot about it in https://github.com/koreader/crengine/blob/1a9e79e25a5b4510d7aaff238d5239f2da70d8d0/cr3gui/data/html5.css#L240-L256 :)

You could (not sure you can on Android) add a line to koreader/data/html5.css:

--- a/data/html5.css
+++ b/data/html5.css
@@ -243,6 +243,7 @@ sup {
 ruby {
   display: ruby;
   text-align: center;
+  text-align-last: initial;
   text-indent: 0;
 }
 rb, rubyBox[T=rb] {

Seems to do the trick:
image

You could add it to a user/book style tweak if you want to solve your issue today:
ruby { text-align-last: initial }

(Minor issue, so it will wait a bit before reaching KOReader.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants