foliate icon indicating copy to clipboard operation
foliate copied to clipboard

ebooks unreadable

Open zchap26 opened this issue 3 years ago • 9 comments

Hello,

I have got three ebooks that are not displayed properly when using either calibre on Windows or foliate on Linux. Using the EPUB.js Input Example page generates the same issue.

When opened in Adobe Digital Editions, the ebooks are readable. I do not want to use Adobe Digital Editions.

I am reporting the problem here because since submitting the issue on 01.03.2021, there has only been scant activity on futurepress/epub.js. Seeing that there are bug reports for epub.js on johnfactotum/foliate and that there is johnfactotum/epub.js, I am hoping that maybe this is the right place.

The ebooks in question are:

  1. The Anesthetic Crisis Manual
  2. The Resuscitation Crisis Manual
  3. The Perfusion Crisis Manual

The issue occurs every time one of the ebooks is displayed and affects all pages.

Can this be fixed?

Regards,

zchap26

Screenshot from 2021-03-01 15-02-29

Screenshot from 2021-03-01 15-03-04

Screenshot from 2021-04-30 09-45-46

zchap26 avatar Apr 30 '21 07:04 zchap26

@zchap26 There are many reasons for which a book can be unreadable.

What is your Foliate version?

What is your install method?: meson, flatpak, snap, which other?

Does this happen with (free/libre) Gutenberg Books?

All of these books seem proprietary. Perhaps there is a problem with the DRM fonts? (if any)

Have you tried changing the default font? On the right in Foliate > Menu > Font button

Maybe it's the spacing. You can change that in Foliate, too.

Consider unticking "Use Publisher Font" in Foliate.

One final option is if you are willing to edit the epub with calibre. Then you would remove the fonts entirely from the epub. This way any reader that is viewing the locally edited files will use the system font, which presumably solves the problem.

itprojects avatar May 01 '21 12:05 itprojects

Can't say for sure without seeing the files, but those look like fixed layout books with hardcoded spacing designed to work with a specific font, and it looks broken when the font is not loaded.

Now, as to why the font failed to load, I haven't any idea. Might be that the format isn't supported by WebKitGTK, or maybe Epub.js isn't resolving the path properly, or some other issue.

johnfactotum avatar May 02 '21 15:05 johnfactotum

Foliate 2.6.3 flatpak Don Quixote seems to display without any issues changing the default font does not resolve the issue changing the spacing does not resolve the issue Use Publisher Font was not ticked, changing this option does not seem to have any effect

zchap26 avatar May 06 '21 08:05 zchap26

If other ePub's like Don Quixote display acceptably (enough), then Foliate is working.

Note: If The books display (too) perfectly in Adobe products that can be an issue. Epubs are essentially html pages; some html pages optimised for Mac/Win browsers, can show defects when displayed in Linux browsers. Maybe the ePub's are perfect, but for the wrong OS or browser (webkit).

Can this be fixed?

No.

itprojects avatar May 07 '21 16:05 itprojects

same issue here , ebub is good in other readers ( moon reader on android and calibre on linux ) ,

sample sshot ( left foliate, right calibre ) 2021-06-27_14-02-22

font is roboto in both readers, changing font also doesn't help. broken rendering is constant with all fonts .

edit : same issue as in #650

Iss-in avatar Jun 27 '21 08:06 Iss-in

I think I know why the fonts aren't loaded. It's probably because the fonts are obfuscated. If you unzip the EPUB file, you should see a file called encryption.xml in the META-INF/ directory. Obfuscated fonts need to be decrypted, which Epub.js doesn't do. So the fonts don't work.

johnfactotum avatar Dec 14 '21 06:12 johnfactotum

If it's true, then if you delete the encryption.xml file, delete the font files, zip the extracted files into a new zip with the same structure, and rename to file.epub, then this problem should disappear.

itprojects avatar Dec 17 '21 15:12 itprojects

@itprojects If it's true, doing those things will not make the problem disappear.

First of all, currently obfuscated fonts are already ignored. So deleting them will do nothing.

But more importantly, in fixed layout books, the position of all the text is fixed, so the correct font is required. If you've ever opened a PDF that forgets to embed a specific font, you'd see the same kind of broken rendering.

johnfactotum avatar Dec 17 '21 15:12 johnfactotum

@johnfactotum You're probably right. No harm in trying, maybe we learn something for debug :)

itprojects avatar Dec 17 '21 16:12 itprojects

Fixed in the gtk4 branch.

johnfactotum avatar Oct 25 '22 06:10 johnfactotum