readium-css icon indicating copy to clipboard operation
readium-css copied to clipboard

Letter-spacing for japanese

Open JayPanoz opened this issue 1 year ago • 9 comments

I'm submitting a topic for discussion.

Short description of the issue/suggestion:

letter-spacing has been enabled as a user setting for Japanese in Thorium and I’m wondering if we should enable it globally in ReadiumCSS.

At the time we first checked it was unclear whether it would help A11y-wise for CJK but feedback has been collected since and maybe we could improve on this front.

JayPanoz avatar Apr 19 '24 11:04 JayPanoz

Letter spacing has also been implemented in the Preferences API for Readium Mobile.

HadrienGardeur avatar Apr 19 '24 11:04 HadrienGardeur

Thanks for the quick feedback, I guess this pretty much answers this question then. 🙏

JayPanoz avatar Apr 19 '24 12:04 JayPanoz

just to be clear, Thorium has always offered letter-spacing but the issue was that ReadiumCSS was explicitly excluding Japanese, so we forced this.

danielweck avatar Apr 19 '24 14:04 danielweck

also, word-spacing for Japanese with wbr elements required CSS and JavaScript tricks to get working. it is a non-standard technique but it works for Thorium JA users.

danielweck avatar Apr 19 '24 14:04 danielweck

We have letter-spacing in the mobile toolkits but it's only marked as "effective" with the default stylesheet – so no CJK or RTL. We followed the instructions from Readium CSS's doc.

Let me know if it needs to be updated.

mickael-menu avatar Apr 19 '24 18:04 mickael-menu

@mickael-menu not at the moment but there is a use-case for JA users, as demonstrated in Thorium. At the time we researched a11y, resources were lacking for CJK and RTL. It’s probably worth researching this topic again and see if we can enable the setting for more languages.

My to-do list then:

  • [ ] research letter-spacing and word-spacing for CJK and RTL – although word-spacing might be really challenging in CSS-only, as reported by Daniel
  • [ ] modify the user-setting submodules if needed
  • [ ] import the user-setting submodules in the “bundleable stylesheets”
  • [ ] update documentation

JayPanoz avatar Apr 22 '24 08:04 JayPanoz

If you need, I think you could reach out to these users for more insights with CJK:

  • https://github.com/readium/swift-toolkit/discussions/370
  • https://github.com/readium/kotlin-toolkit/issues/458

In particular, it looks like the paginated mode doesn't work as they expected.

mickael-menu avatar Apr 22 '24 11:04 mickael-menu

Some interesting issues from WCAG – looks like we’re not the only ones struggling on this topic:

JayPanoz avatar Apr 23 '24 12:04 JayPanoz

Proposed resolution: I guess it will make more sense enabling it for all CJK, and letting implementers enable/disable the setting as they see fit – and make it clear in documentation.

JayPanoz avatar May 16 '24 11:05 JayPanoz