Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2014, 02:53 AM   #1
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
Attached Files
File Type: zip saint-arnaud 2.zip (1.78 MB, 283 views)

Last edited by roger64; 03-25-2014 at 03:06 AM.
roger64 is offline   Reply With Quote
Old 03-25-2014, 03:13 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 03-25-2014, 05:02 AM   #3
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by kovidgoyal View Post

As you can see the errors are not self inflicted by the editor.
I can't deny but how do you explain this?
- 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.
roger64 is offline   Reply With Quote
Old 03-25-2014, 06:08 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 03-25-2014, 10:13 AM   #5
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thank you for looking at it and for your advice.
roger64 is offline   Reply With Quote
Old 03-25-2014, 09:43 PM   #6
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
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.
roger64 is offline   Reply With Quote
Old 03-26-2014, 12:13 AM   #7
AnotherCat
....
AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.AnotherCat ought to be getting tired of karma fortunes by now.
 
Posts: 1,547
Karma: 18068960
Join Date: May 2012
Device: ....
Quote:
Originally Posted by roger64 View Post
So the reality is that Sigil corrects automatically the existing structural defects of my EPUB and that the calibre Editor does not do it...
Have you tried in Editor menu Tools>Arrange into folders?
AnotherCat is offline   Reply With Quote
Old 03-26-2014, 12:19 AM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by AnotherCat View Post
Have you tried in Editor menu Tools>Arrange into folders?
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).
eschwartz is offline   Reply With Quote
Old 03-26-2014, 01:21 AM   #9
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by eschwartz View Post
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).
Indeed I was very surprised to learn that Sigil checks and corrects the structure just on opening a file. I thought it only did it when saving...

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.
roger64 is offline   Reply With Quote
Old 03-26-2014, 01:23 AM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 03-26-2014, 01:29 AM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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:
Originally Posted by roger64 View Post
Indeed I was very surprised to learn that Sigil checks and corrects the structure just on opening a file. I thought it only did it when saving...

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.
By "the usual way" I meant renaming the file. Since the reference doesn't match up until you do, it won't mess up the manifest and other references. But once renamed, it will snap into sync with the references, just like in Sigil, which also merely renamed the path of the font.
eschwartz is offline   Reply With Quote
Old 03-26-2014, 03:48 AM   #12
roger64
Wizard
roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.roger64 ought to be getting tired of karma fortunes by now.
 
Posts: 2,624
Karma: 3120635
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@eschwartz

Quote:
Originally Posted by kovidgoyal View Post
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.


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.
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 03:19 AM.


MobileRead.com is a privately owned, operated and funded community.