Skip to content

Add Literata as a bundled reading-optimized font option - #1535

Open
sgreadly wants to merge 1 commit into
crocodilestick:mainfrom
sgreadly:feature/literata-reading-font
Open

Add Literata as a bundled reading-optimized font option#1535
sgreadly wants to merge 1 commit into
crocodilestick:mainfrom
sgreadly:feature/literata-reading-font

Conversation

@sgreadly

Copy link
Copy Markdown

Adds Literata as a bundled reading-optimised font option

The reader's font picker only offered Default, Yahei, SimSun, KaiTi, and Arial. The first three are Chinese-language system fonts with no benefit for non-CJK text, and neither Default nor Arial was designed specifically for on-screen reading comfort.

Changes:

  • Bundles Literata (Google's OFL-licensed serif, used in Google Play Books, purpose-built for on-screen reading) in all four required weights
  • Adds a "Literata" button to the font picker
  • Injects the @font-face rules into each chapter's rendered iframe via epub.js's hooks.content.register, so the font actually renders inside book content rather than silently falling back to a system font
  • Updates the saved-preference restore logic so reopening a book correctly remembers a Literata selection

Closes #1534

- Bundles Literata (OFL-licensed) in Regular/Italic/Bold/BoldItalic
- Adds a Literata button to the reader's font picker, alongside Default/Yahei/SimSun/KaiTi/Arial
- Injects @font-face rules into each chapter's rendered iframe via
  epub.js hooks.content.register, so the font is actually available
  inside book content rather than silently falling back
- Updates the saved-font-preference restore map to include Literata

Closes crocodilestick#1534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Literata as a bundled reading-optimized font option

1 participant