07-09-2012, 03:52 AM | #16 |
Pest
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
|
|
07-09-2012, 03:57 AM | #17 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Now that I can get the fonts to show up on my Touch, it isn't the obfuscation. It's probably some other field in the header that the Touch requires to enable "publisher font support". Unfortunately, I am way too busy right now to go through the dance of change header fields, copy to touch, open book, curse Amazon's stupidity, rinse and repeat. So this isn't going to be fixed anytime soon.
Patches welcome. |
Advert | |
|
07-09-2012, 09:59 AM | #18 |
Pest
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
|
I know nothing about those fields but if there is a way to browse and edit them - even with an hex editor - I'll be glad to try. Could you please redirect me to some info about the header structure?
Last edited by pirl8; 07-09-2012 at 11:36 AM. |
07-09-2012, 12:01 PM | #19 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use mobi2mobi and there is a wiki page that documents the MOBI header in the mobileread wiki. And of course there is the calibre source code. Look in the ebooks/mobi/*.py files.
You can dump a mobi's headers (and all records) in a nice text representation on which you can run diff by calibre-debug --inspect-mobi filename.mobi Compare a kindlegen mobi to a calibre mobi and see if you can spot the difference. If you find something that look suspicious either zero it out in the kindlegen mobi or change it in the calibre mobi (the latter is much harder if it involves adding fields) But be warned, the MOBI format was designed by a bunch of monkeys on a sugar high. Last edited by kovidgoyal; 07-09-2012 at 12:04 PM. |
07-09-2012, 06:37 PM | #20 |
Pest
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
|
I build a simple book with nothing else but a content page, a font, a cover image and a stylesheet. There are many differences between KindleGen and Calibre generated file, but most are different offsets.
The most noticeable ones are the "KF8 resources (images/fonts) count (125)" EXTH header which is 0 for KindleGen and 4 for Calibre and a couple of fields which are present in the KindleGen EXTH header and absent in Calibre: Code:
fontsignature (300): '\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\xfd\xe9\xe6' KF8 cover URI (129): 'kindle:embed:0001' I've also unsuccesfully tried to manually add the header to the Calibre generated file (changed EXTH header length, file count and padding but obviously I'm missing something). :-( |
Advert | |
|
07-10-2012, 12:33 AM | #21 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can easily patch the calibre source code to add field to the EXTH header. Edit the build_exth function in mobi/writer8/exth.py. Instructions for running calibre from source are here: http://manual.calibre-ebook.com/develop.html
|
07-10-2012, 06:30 PM | #22 | |
Sigil Developer
Posts: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi,
Kindlegen generated mobis have two headers and two EXTH sections, not just one. Have you tried setting the fontsignature payload to 0x2a in both mobi header exth regions to see if that impacts the problem? I don't think mobi2mobi prperly deals with both headers in kindlegen generated mobis so you will have to use a hex editor to change both. You might want to check out Mobi_Unpack to see how to find both headers. Please let us know what you find out. Thanks, Kevin Quote:
|
|
07-12-2012, 07:12 AM | #23 | |
Pest
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
|
Quote:
I changed the fontsignature EXTH header via Hex editor in both locations as a sequence of '*'. Now calibre-debug -m my.azw3 reads: Code:
fontsignature (300): '************************************************' I will try to run Calibre from sources as Kovid suggested and add that header to see if the generated azw3 will behave differently. I'm attaching my ePub sample if anyone else wishes to try. Last edited by pirl8; 07-12-2012 at 07:33 AM. |
|
07-12-2012, 01:18 PM | #24 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@pirl8: Try this. (Header looks patched, haven't actually put anything on my Touch to check yet).
EDIT: Killed deprecated attachments. Fix merged upstream. Last edited by NiLuJe; 09-30-2012 at 05:17 PM. |
07-12-2012, 01:42 PM | #25 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Where can I find the ZIP file of the source code for 0.8.59?
|
07-12-2012, 01:51 PM | #26 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@JSWolf: http://calibre-ebook.googlecode.com/...-0.8.59.tar.xz (Among other places, it's also mirrored on SF).
The patch also applies cleanly to a bzr checkout. |
07-12-2012, 02:03 PM | #27 | |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
07-12-2012, 02:08 PM | #28 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@JSWolf: 7-zip should do it, albeit probably in two passes.
|
07-12-2012, 02:26 PM | #29 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
07-12-2012, 03:20 PM | #30 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Questions about KF8/AZW3/Mobi8 from/to conversion | pirl8 | Calibre | 12 | 09-14-2015 11:01 AM |
Science Fiction Wells, H.G.: The War of the Worlds. KF8/AZW3. v1.0 2012-05-21 | JSWolf | Other Books | 5 | 09-13-2012 06:43 AM |
Embedding fonts | JaneFancher | Calibre | 14 | 04-10-2010 09:28 PM |
Embedding fonts | AprilHare | ePub | 6 | 01-02-2010 11:42 AM |