Copy link to clipboard
Copied
Software and environment
Windows 10
Adobe InDesign CS6
Calibre 2.85.1 (64 bit)
Adobe Digital Editions 4.5.5
Summary of problem 1
My EPUB produced in InDesign has embedded fonts. When I work on my EPUB in Calibre Editor and save the embedded fonts are no longer recognised in ADE. The Latin font I am using is Gentium (download: http://software.sil.org/gentium/download). I am also using a non-Latin font for a RTL language.
Steps to reproduce problem 1
1) Make book in InDesign and export to EPUB 2.0.1
2) Open file in ADE...everything works fine
3) Open file in Calibre Editor using default preferences
4) Make a change and undo it
5) Save EPUB
6) Open EPUB in ADE
7) The embedded fonts are no longer recognised!!
Fix to problem 1 and subsequent problem 2
1) Make book in InDesign and export to EPUB 2.0.1, do not embed fonts
2) Open file in Calibre Editor using default preferences, embed fonts
3) Save EPUB
4) Open EPUB in ADE
5) The fonts have embedded and can be seen in ADE but the bold weight is no longer recognised!!
Report
The Calibre developer kindly looked into this for me and says as follows:
1) The epub with embedded fonts from InDesign declares it is using the
IDPF font obfuscation algorithm but is not actually using it. At least
trying to de-obfuscate the fonts with it does not work. I'm guessing they
are using some unholy combination of the IDPF and their own obfuscation
algorithm. This is why resaving the file with the editor breaks the
fonts.
2) When embeddeding the fonts without obfuscation using the editor, I
noticed that ADE renders [one character] as bold, but nothing else.
Which means it is successfully loading the font. So this is definitely an ADE bug.
Copy link to clipboard
Copied
I have found another way to break the way an EPUB displays embedded fonts in ADE: unzip and rezip!
No matter how I try to unzip and rezip an EPUB made in InDesign, there are problems when viewing the embedded fonts in the rezipped EPUB in ADE.
I think it is quite normal to want to unzip an EPUB to modify the source files and to then rezip it. But this is not possible if I want to maintain compatability with ADE.
Now, I could avoid unzipping the EPUB and work within the archive to edit the source files. However, when I finish editing and save the files it creates the problem that the mimetype file in the EPUB archive is no longer recognised as the first to be added to the archive and this causes a validity problem according to the IDPF specifications.
The only way to avoid this that I can see is to re-make the ZIP file which the EPUB is based on but then we end up in a circle because the font embedding breaks for ADE!
Here is what IDPF say about the mimetype file:
mimetype entry missing or not the first in archive
A valid EPUB file must contain an uncompressed file named mimetype as a first entry in the zip archive. That file must contain EPUB mime type (application/epub+zip
).
Errors · IDPF/epubcheck Wiki · GitHub
In the next post I will post a full list of the tedious steps to show I have been rigorous in unzipping and rezipping.
Copy link to clipboard
Copied
EPUB unzip and re-zip in Windows 10
EPUB unzip and re-zip with 7ZIP (no compression)
EPUB unzip and re-zip with 7ZIP (no compression) (variation 1 to use 7zip exclusively)
EPUB unzip and re-zip with 7ZIP (no compression) (variation 2 to use 7zip exclusively)
EPUB unzip and re-zip with Winrar (no compression)