readium-js: Font decryption fails
I have deployed the Readium cloud reader on my web server, and noticed that encrypted fonts don’t render. After playing around with the epub contents and stepping through the Readium-JS code, I found out that if you remove the prefix enc:
from all elements in the encryption.xml
file, it works.
The issue is in the encryption_handler.js file where jQuery is used. As you can see, it does not include looking for the nodes with the enc:
(namespace?) prefix.
You can see an example encryption.xml file from the spec here, and it includes the enc:
prefixes. My EPUB was created with Sigil 0.9.7 and uses Adobe’s method. IDPF’s method gives the same result.
This issue is a Bug
Expected Behaviour
Decode the fonts as expected.
Observed behaviour
Doesn’t decode the fonts and shows the fallback font.
Steps to reproduce
- Create an ebook with Sigil
- Add a font (otf or ttf) and make a css font-face and use it in the ebook
- Apply Adobe or IDPF’s protection
- Save and open with Readium
Test file(s)
EPUB with enc:
prefixes: https://books.djazz.se/epub_content/project_sunflower/notworking.epub
EPUB with the prefixes removed: https://books.djazz.se/epub_content/project_sunflower/working.epub
Online version with enc:
prefixes: https://books.djazz.se/?epub=epub_content%2Fproject_sunflower
The font is Adobe Garamond Pro (subsetted). Ebook shared with permission.
Product
- Readium cloud reader app
- https://books.djazz.se/ Latest stable release
- Chromium 60
- Manjaro Linux
Additional information
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Fix for encryption.xml parsing (obfuscated fonts) where XML namespace prefixes are used. Fixes #753 Fixes #183 — committed to readium/readium-js by danielweck 3 years ago
I believe the bug was recently fixed. Can you please confirm: https://readium.firebaseapp.com/?epub=https%3A%2F%2Fcors-anywhere.herokuapp.com%2Fhttps%3A%2F%2Fbooks.djazz.se%2Fepub_content%2Fproject_sunflower%2Fnotworking.epub&goto=epubcfi(/6/10!/4/2/1:0)