09-19-2022, 12:15 PM | #1 | |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
EPUB3: ...obfuscated fonts, but...key missing from OPF
I don't know if this is a problem with Calibre 6.5.0 or with the book (it's C.S. Friedman's "When True Night Falls"). But, when I convert a book to EPUB3 (either from the library page or from within the editor), I get this when trying to open it:
Quote:
Code:
<manifest> <item id="id1" href="fonts/00068.otf" media-type="font/otf"/> <item id="id2" href="fonts/00069.otf" media-type="font/otf"/> Code:
<encryption xmlns="urn:oasis:names:tc:opendocument:xmlns:container" xmlns:enc="http://www.w3.org/2001/04/xmlenc#" xmlns:deenc="http://ns.adobe.com/digitaleditions/enc"> <enc:EncryptedData> <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/> <enc:CipherData> <enc:CipherReference URI="fonts/00068.otf"/> </enc:CipherData> </enc:EncryptedData> <enc:EncryptedData> <enc:EncryptionMethod Algorithm="http://ns.adobe.com/pdf/enc#RC"/> <enc:CipherData> <enc:CipherReference URI="fonts/00069.otf"/> </enc:CipherData> </enc:EncryptedData> </encryption> Code:
<item id="id1" href="fonts/00068.otf" media-type="application/vnd.ms-opentype"/> <item id="id2" href="fonts/00069.otf" media-type="application/vnd.ms-opentype"/> If I convert from that EPUB2 to an EPUB3 in the editor and look at the changes (before closing the editor down and re-opening it), the only instances of "font" are those same two unchanged font lines in content.opf. Once I save, shut down the editor and re-open the epub (as an EPUB3), I get that same error message. Worse, I can't see any of the content/files in the epub. If I run the epub through the Modify ePub PI and have it Remove Embedded Fonts, I can once again edit the book, and all the contents are there. The fonts are gone (obviously), but the encryption.xml is still there (and looks the same) and the fonts are missing from the content.opf (again, obviously). Doing conversions like this in the previous Calibre version went fine. Is there something else I can check or post here? EDIT: I was hoping I could check this with the previous book in the series, since I edited under Calibre 6.4.0 without problem. But, it has no fonts (and converts just fine). I'll have to look around and see if I can find any other books with embedded fonts and see how they convert under 6.5.0. EDIT2: Still haven't found another book with fonts. But, I redownloaded this book fresh from Amazon and got the same behavior. Are those fonts supposed to have a red shield on them? Does that indicate a problem or does it indicate that the fonts are encrypted? Last edited by enuddleyarbl; 09-19-2022 at 12:43 PM. |
|
09-19-2022, 12:50 PM | #2 | |
Resident Curmudgeon
Posts: 74,528
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
When you have a look at the KF8 version, what are the fonts that are embedded? You should be able to find out from looking at the font code in the CSS. Do you actually need them? But if you do want the fonts, you can use KindleUnpack to convert the KF8 to ePub and then load it into Sigil and remove the obfuscation. You do also have to check for errors using epubcheck and fix any errors. There will be some. |
|
Advert | |
|
09-19-2022, 01:02 PM | #3 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
It looks like the font(s) is "Shift Light":
Code:
@font-face { font-family: "Shift Light"; font-style: normal; font-weight: normal; src: url(../fonts/00068.otf); } @font-face { font-family: "Shift Light"; font-style: italic; font-weight: bold; src: url(../fonts/00069.otf); } Also, I found another book with fonts (and they're red-shielded as well): Jim Butcher's "Peace Talks." It has the same problem all around. Oddly, it too uses those two Shift Light fonts. So, I'd guess it's an actual Calibre issue. |
09-19-2022, 01:15 PM | #4 | |
Resident Curmudgeon
Posts: 74,528
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Those shift fonts are garbage. They are from Penguin Random House for an advertisement. You can delete the fonts and you can delete that HTML file. It's the last HTML file. |
|
09-19-2022, 01:24 PM | #5 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Well, I've now found several AZW3 books with fonts in them (not even red-shielded fonts). Calibre won't convert any of them to EPUB3 correctly. Every one of them opens with that same problem once converted. If I convert an AZW3 without fonts, it converts just fine.
So, it looks like a Calibre issue to me. I'm going to see if I can load up the previous version and see what happens with that. |
Advert | |
|
09-19-2022, 01:24 PM | #6 |
creator of calibre
Posts: 43,991
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Opena bug report and attach an epub2 file that reproduces the issue.
|
09-19-2022, 02:06 PM | #7 | |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
https://bugs.launchpad.net/calibre/+bug/1990185 |
|
09-19-2022, 02:31 PM | #8 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Just a wee bit more information. It's not an issue with just 6.5.0. I uninstalled it and re-installed 6.4.0. Same issue.
|
09-19-2022, 04:37 PM | #9 |
Bibliophagist
Posts: 36,481
Karma: 145748884
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
@enuddleyarbl: Please note that the key for font encryption is very often the dc:identifier found in content.opf and anything that modifies it will disable font decryption. And yes. a calibre conversion can and will break the ability to decrypt fonts. One of the reasons I prefer to use KindleUnpack to generate epubs from a KF8/azw3 file.
See Font obfuscation in EPUBs and why you shouldn't change the dc:identifier after exporting from InDesign and/or Font Embedding for Open Container Format Files for more information. Samples from a KindleUnpack and a calibre converted epub: Kindle Unpack (note the epub v3.0 version): Code:
<?xml version="1.0" encoding="utf-8"?> <package version="3.0" unique-identifier="uid" prefix="calibre: https://calibre-ebook.com" xmlns="http://www.idpf.org/2007/opf"> <metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> <dc:identifier>uuid:53f2730e-fc4f-43ef-9be0-1f8dcd019e01</dc:identifier> <dc:identifier id="uid">1607628343</dc:identifier> calibre converted (note the epub v2.0 version): Code:
<?xml version="1.0" encoding="utf-8"?> <package version="2.0" unique-identifier="uuid_id" xmlns="http://www.idpf.org/2007/opf"> <metadata xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <dc:identifier id="uuid_id" opf:scheme="uuid">05ac5b14-e9b8-47ec-9ff6-96431094e93d</dc:identifier> Last edited by DNSB; 09-19-2022 at 04:45 PM. Reason: Added sample identifiers from KindleUnpack and calibre conversion |
09-19-2022, 06:24 PM | #10 | |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Quote:
The KU version of a book: Code:
<dc:identifier>mobi-asin:B0030P1W9A</dc:identifier> <dc:identifier>isbn:9780307575357</dc:identifier> <dc:identifier>calibre:461</dc:identifier> <dc:identifier>uuid:9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> <dc:identifier id="uid">3359571780</dc:identifier> <dc:identifier>urn:uuid:f886b17f-3a7d-4826-8ad7-fcfe0c38f40a</dc:identifier> Code:
<dc:identifier id="calibre_id" opf:scheme="calibre">9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> ... <dc:identifier opf:scheme="ISBN">9780307575357</dc:identifier> <dc:identifier opf:scheme="MOBI-ASIN">B0030P1W9A</dc:identifier> Code:
<dc:identifier id="uuid_id" opf:scheme="uuid">urn:uuid:9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> ... <dc:identifier opf:scheme="calibre">9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> <dc:identifier opf:scheme="MOBI-ASIN">B0030P1W9A</dc:identifier> <dc:identifier opf:scheme="ISBN">9780307575357</dc:identifier> Code:
<dc:identifier id="uuid_id">uuid:9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> ... <dc:identifier>calibre:9280af86-82f9-4a3d-8087-e2091a2bcecb</dc:identifier> <dc:identifier>MOBI-ASIN:B0030P1W9A</dc:identifier> <dc:identifier>ISBN:9780307575357</dc:identifier> EDIT1: it's odd, then, that the book seems fine as an AZW3 and EPUB2. But, as an EPUB3, with the same dc:identifiers, it fails. /EDIT1. EDIT2: I guess, from your first link, the dc:identifiers have to be exactly the same, and, possibly, in the same order. /EDIT2. Of course, at my Joe-Bag-O-Donuts level, I just assumed Calibre could convert anything it opened and I wouldn't have to pay attention to whether or not the book contained fonts. I guess I'll go back to stripping all the font stuff out of the books when I play with them. Since I use my Kobo's fonts instead of the Publisher Defaults, I should be fine. Last edited by enuddleyarbl; 09-19-2022 at 06:39 PM. |
|
09-19-2022, 06:38 PM | #11 |
Resident Curmudgeon
Posts: 74,528
Karma: 129670952
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I would not willy nilly strip fonts without checking them out first. I do strip the main font as it's not the one I want to use to read with. But there are sometimes other fonts that I do keep as they do enhance the eBook such as a font for handwritten notes (for example).
|
09-19-2022, 08:14 PM | #12 |
Grand Sorcerer
Posts: 6,551
Karma: 84810789
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
|
Relevant to what is going on here in case it is not clear, Kindle formats do not contain an OPF. The one you see is constructed by either KindleUnpack or calibre using metadata from the AZW3 file. Each piece of software has its own method for doing it. There is no single correct way.
There is no direct equivalent to the EPUB identifier in AZW3. AZW3 format supports obfuscated fonts but uses a separate key stored with each font. There really does seem to be a calibre bug in conversion of books with multiple identifiers and obfuscated fonts to EPUB 3 but is it only tangentially related to AZW3 as the source format. |
09-30-2022, 11:07 AM | #13 |
Guru
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
|
Just downloaded Calibre 6.6.1 and the fonts are coming over just fine when converting to EPUB3. Thanks!
I've got another font question, but since it's merely an informational one, I'll start another thread. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibe issue with obfuscated fonts. | DNSB | Calibre | 4 | 10-15-2019 02:58 PM |
epub3 kobo external video opf issue | Ryn | ePub | 21 | 01-13-2018 05:34 PM |
OPF missing opf metadata tag | AlanHK | ePub | 1 | 07-25-2017 11:17 AM |
ePub->ePub conversion with obfuscated fonts | DiapDealer | Conversion | 1 | 03-17-2012 02:33 PM |
OPF file OPS/package.opf is missing | Run2Eat | ePub | 2 | 05-31-2011 06:52 PM |