![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Calibre Editor mishandles display of otf files
Hi
To illustrate what I consider to be a calibre Editor bug, I used a book that I published on MR last year. But I found the same defect for the same kind of files on another book. The EPUB file included below has been converted by writer2xhtml from the odt file (also included). I have been using writer2xhtml for the last three years. Please pay attention that the EPUB file below has never been saved and is coming straight from the converter. It's a kind of virgin on this regard. There is still some homework to do to finish this EPUB. a) I need the following three-step process to get a clean EPUB with the calibre editor: 1. - opening the EPUB with Sigil 0.6.2 and saving it (just to rescue 611 nbsp from imminent slaughter). It includes also 1971 nnbsp (such is French language) 2. - opening the EPUB with Sigil 0.7.4 and doing some homework 3. - opening with calibre Editor and finishing the homework Doing it this way, I can get out of any problem but of course it's a tedious and unintuitive process... b) Why not open it directly with the calibre Editor? I did try it and it triggers a big problem with the display of each of the two embedded otf fonts: On top of some small defects, the Editor reports the two following mistakes that I was unable to repair: - le fichier n'est pas référencé (non referenced file) - la ressource liée n'existe pas (linked resource does not exist). I maybe wrong but I think these two above mistakes are self-inflicted by the calibre Editor: when I open directly the EPUB with the calibre Editor, it writes a book.opf file (Sigil does the same but names it content.opf). Opening this book.opf file, I can see in the manifest that the items representing the otf fonts are wrongly written. I can read: <item href="styles/LinLibertine etc. instead of <item href="Fonts/LinLibertine etc. I let you compare by yourself the differences obtained when - first saving with old Sigil version (6.2) - first saving with calibre Editor. Last edited by roger64; 03-25-2014 at 03:06 AM. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,240
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Here's the output of running epubcheck on your epub file:
Epubcheck Version 3.0.1 Validating against EPUB version 2.0 ERROR: /t/saint-arnaud 2/Lettres de Saint-Arnaud - 1.epub/OEBPS/styles/styles.css(10,2): 'OEBPS/Fonts/LinLibertine_R.otf': referenced resource missing in the package. ERROR: /t/saint-arnaud 2/Lettres de Saint-Arnaud - 1.epub/OEBPS/styles/styles.css(17,2): 'OEBPS/Fonts/LinLibertine_RI.otf': referenced resource missing in the package. Check finished with warnings or errors As you can see the errors are not self inflicted by the editor. |
![]() |
![]() |
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
- Open with Sigil 0.6.2. and save (nothing else). Flightcrew reports no mistake. - then open with Sigil 0.7.4 and save (nothing else). Epubcheck 3.0.1. validating as Epub2 reports no mistake. Looks like Sigil puts something straight that calibre does not. Remember please that the EPUB has never been saved previously. Last edited by roger64; 03-25-2014 at 05:13 AM. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,240
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibre does not make any changes to the epub file, simply by opening it, unlike sigil. That EPUB file is broken it just happens to be broken in a way that sigil's automatic file renaming fixes. If you want to fix it in calibre, rename the font files referenced in the error message from OEBPS/styles/LinLibertine_R.otf to OEBPS/Fonts/LinLibertine_R.otf
And report the bug to the developer of writer2xhtml. Last edited by kovidgoyal; 03-25-2014 at 06:13 AM. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Thank you for looking at it and for your advice.
|
![]() |
![]() |
![]() |
#6 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
So the reality is that Sigil corrects automatically the existing structural defects of my EPUB and that the calibre Editor does not do it.
If I wish to correct manually my broken EPUB (the one unsaved) with the calibre Editor, it looks like a fairly simple task: I know the good final structure to respect (a Fonts folder, manifest with the right path, @font-face). I tried several times to correct manually the manifest using the calibre Editor, but I failed like if my manual changes were not taken into account. If a direct manual change in the manifest is not possible, what is the recommended way to modify the manifest? Last edited by roger64; 03-25-2014 at 09:46 PM. |
![]() |
![]() |
![]() |
#7 |
....
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
|
|
![]() |
![]() |
![]() |
#8 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Which is the same as doing it manually, only faster. But I think @roger64 was merely wondering what Sigil was doing in the first place that fixed the broken link. Now he knows, he can fix it the usual way(s).
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Quote:
The Tool "arrange into folders" (thanks AnotherCat) does not help on this regard. I am afraid also that the "usual way" I knew with Sigil to modify files does not work identically here. Take the manifest: I modify the path of the item, setting Fonts instead of styles. The change takes place. But if I verify, the Editor still reports a mistake. I would be keen to learn how to make do with the manual edits of the Editor. If somebody knows how to fix this broken EPUB with the Editor, I am keen to learn. Last edited by roger64; 03-26-2014 at 01:23 AM. |
|
![]() |
![]() |
![]() |
#10 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,240
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
All you have to do is right click on the font file in question and choose rename, then replace the "styles" part of the file name with "Fonts". You do not need to touch the manifest or anything else.
|
![]() |
![]() |
![]() |
#11 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
|
|
![]() |
![]() |
![]() |
#12 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
@eschwartz
Quote:
![]() Solved. ![]() I wish I could change the mistaken title of this thread. I really learnt a couple of useful things. What seems obvious is not always true (I speak for me ![]() What mistook me - among other things, was the fact that my fonts did appear in the Fonts folder of the calibre Editor. Seeing this, I thought that the mistake was coming from elsewhere, maybe from the manifest. Last edited by roger64; 03-26-2014 at 04:12 AM. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Files changed on opening in the Editor | Ripplinger | Editor | 5 | 08-27-2014 08:43 AM |
Editor chmod's files | eschwartz | Editor | 2 | 03-13-2014 03:46 PM |
otf, ttf, something else? | Artha | ePub | 10 | 11-27-2011 12:10 PM |
*.otf fonts on PocketBook | kacir | PocketBook | 1 | 01-17-2010 04:55 PM |
Lit files display a little odd | coryj | Amazon Kindle | 21 | 02-27-2008 12:11 PM |