Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 03-25-2014, 10:42 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,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
referenced resource missing in the package

Hi

I opened this thread on the calibre forum because I was puzzled by something.
https://www.mobileread.com/forums/sho...d.php?t=236427

It concerns one EPUB file of mine, coming straight from the converter writer2xhtml, and unsaved. Epubcheck reports two referenced resources missing in the package concerning the two otf fonts.

If I open the EPUB (with any Sigil from 0.6.2 to 0.7.4), I can see that the two otf files are in the Fonts folder, their relevant item in the manifest (content.opf) has the right src path (../Fonts/xxxx and resource

Code:
<item href="Fonts/LinLibertine_R.otf" id="resource5" media-type="application/vnd.ms-opentype" />
    <item href="Fonts/LinLibertine_RI.otf" id="resource6" media-type="application/vnd.ms-opentype" />
I also fail to see any mistake in the @font-face declaration:
Code:
@font-face {
    font-family:'Linux Libertine O';  
    font-weight: normal;
    font-style: normal;
    src: url('../Fonts/LinLibertine_R.otf');
}
Furthermore, if I save it (just saving it, without doing anything), Epubcheck will report no error and I fail to spot the smallest change in the EPUB.

As you can read Kovid Goyal says that this EPUB is "broken". I have been using writer2xhtml for the last three years and I fail to see what is "broken".

Could someone have a look and spot what exactly is "broken"?

Last edited by roger64; 03-25-2014 at 10:49 AM.
roger64 is offline   Reply With Quote
Old 03-25-2014, 10:52 AM   #2
mrmikel
Color me gone
mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.mrmikel ought to be getting tired of karma fortunes by now.
 
Posts: 2,089
Karma: 1445295
Join Date: Apr 2008
Location: Central Oregon Coast
Device: PRS-300
Whenever you take it into Sigil, it restructures the epub to fit its mandatory file structure. It fixes what is broken, which is the path to the file, as I understand it. Calibre does not impose any file structure, so if the path is not right, it will be not right in calibre.
mrmikel is offline   Reply With Quote
Advert
Old 03-25-2014, 11:30 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,799
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
are single quotes permitted in a quoted font-family name? (I always use " )
theducks is offline   Reply With Quote
Old 03-25-2014, 12:11 PM   #4
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by theducks View Post
are single quotes permitted in a quoted font-family name? (I always use " )
Me too, but I don't remember if single-quotes are legal or not. One can check the stylesheet in the CSS validator at W3C, (can be done from within sigil, but the sigil built-in check works against CSS 2.1 (IIRC) which won't tell you anything useful about the font declarations). You have to check it manually against CSS 3.0 (and/or perhaps CSS 2.0). In my experience, if the font declarations pass CSS 3.0, the will be accepted by ADE-based readers and some others. This despite the fact that 2.1 is the standard level for epub.

YMMV, etc.

Albert
st_albert is offline   Reply With Quote
Old 03-25-2014, 12:24 PM   #5
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: 43,853
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What's broken is simple, unzip that epub and you will see the font files are inside the styles folder, not the Fonts folder. You dont see that when you open it in Sigil, because sigil moves all the files around for when you open the epub.
kovidgoyal is online now   Reply With Quote
Advert
Old 03-25-2014, 01:29 PM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by kovidgoyal View Post
What's broken is simple, unzip that epub and you will see the font files are inside the styles folder, not the Fonts folder. You dont see that when you open it in Sigil, because sigil moves all the files around for when you open the epub.
AFAK only the files in the opf file. If there is for example an extention wrong (I know...), it gets lost during the opening. This is sometimes used as a kind of social DRM.
Toxaris is offline   Reply With Quote
Old 03-25-2014, 09:18 PM   #7
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,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Thanks you all for your replies. This comes as a real surprise to me after so many years using writer2xhtml and Sigil. I realize too that the Editor provides no safety net contrary to Sigil.

1. - So, if I still keep using writer2xhtml, I will need to correct it first by opening it with Sigil and avoid using it first with the calibre Editor. Not a big deal but good to know.

2. - The alternative choice is to manually correct it with he calibre Editor. But there is still something here that I do not get: take my broken EPUB (the one unsaved): I should be able to correct it easily. It's 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 proceed? I'll move this question to the calibre Editor thread.

@st_albert, @theducks

Single quotes are OK for fonts, provided you make a consistent use of them in your EPUB. Double quotes are probably more common.

@Toxaris

I did not know there were such thing as "social DRM". I always thought they were totally wild...

Last edited by roger64; 03-25-2014 at 09:37 PM.
roger64 is offline   Reply With Quote
Old 03-25-2014, 11:49 PM   #8
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by roger64 View Post
Thanks you all for your replies. This comes as a real surprise to me after so many years using writer2xhtml and Sigil. I realize too that the Editor provides no safety net contrary to Sigil.

1. - So, if I still keep using writer2xhtml, I will need to correct it first by opening it with Sigil and avoid using it first with the calibre Editor. Not a big deal but good to know.

2. - The alternative choice is to manually correct it with he calibre Editor. But there is still something here that I do not get: take my broken EPUB (the one unsaved): I should be able to correct it easily. It's 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 proceed? I'll move this question to the calibre Editor thread.

@st_albert, @theducks

Single quotes are OK for fonts, provided you make a consistent use of them in your EPUB. Double quotes are probably more common.

@Toxaris

I did not know there were such thing as "social DRM". I always thought they were totally wild...
First, thanks re: the info on single quotes. I've gotten into the habit of using double quotes, because at one time long ago, that is what it took to make it work for me. So, "if it ain't broke, don't fix it" as we say here in the American South.

Next, I've been playing with the files you posted, and first of all, if I convert the .odt file using the stand-alone writer2latex java program (the patch for LO didn't work for me), I don't get any embedded fonts at all. Maybe due to the fact that I don't have those fonts on my system, or due to the specific configuration I have created for writer2latex. (in general we do not embed fonts, so as to simplify our legal obligations.) So no joy there.

However, when I use the calibre ebook editor on your pristine epub, I do notice the fact that the fonts are not properly referenced. I edited not the book.opf file, but the styles.css file, and made the references to the font files match what was the real location of the files (e.g. src: url('../styles/LinLibertine_RI.otf'); and so on.

Check book also complained about improper mimetypes for the fonts, and also a non-linear item in the spine ( the cover). I had the editor correct these errors individually, and then there were only two warnings re: file too large. These I ignored. I then "saved a copy" of the file.

Opening the copy, all errors except the "file too large" errors were now gone. The copy displayed well with the Firefox epub reader, though I didn't test further.

Now, granted that OEBPS/styles is not where I would like the font files to be placed, at least it seems to me that corrections can be made in the ebook-edit app that allow a functional ebook to be produced. (BTW, did the original, untouched ebook from writer2epub display correctly? Not having the proper fonts, I couldn't tell. But I would doubt it.)

When I have the time, I may try to run your original epub thru sigil (to correct the paths) and see what I see. This may corrupt all the nbsp and nnbsp tags, but as I don't speak French very well I probably won't notice whether the correct font, or the correct spacings are preserved.

Maybe others can comment on all of this.

Albert
st_albert is offline   Reply With Quote
Old 03-26-2014, 12:07 AM   #9
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,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The actual location of resource files within an EPUB are arbitrary and hold no meaning or value, other than what we think about it. That being said, I agree with the idea they should be in the right location.

I requested this feature, and Kovid added it: you can now go to Tools ==> Arrange into folders, and specify where each type of file should go; the settings are sticky.
eschwartz is offline   Reply With Quote
Old 03-26-2014, 12:07 AM   #10
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 696
Karma: 150000
Join Date: Feb 2010
Device: none
Oh, and reguarding "social DRM" if I understand correctly, this concept is not unfamilar to those who grew up with AppleII computers and their feeble attempts at DRM. Namely that it refers to a method of DRM that was not easily defeated by those with merely common knowledge of such things, but was fairly easily defeated by those with a relatively better-than-average understanding of how things worked.

As it happened, it developed that virtually every DRM scheme (I'm using the term DRM loosely) fell into the latter category. Eventually even the pretense of DRM was abandoned by software publishers. (And a shout-out to Beagle Brothers, who never messed with that nonsense to begin with.)

(Correct me if I'm wrong -please!- , because I'm always interested in the history of DRM attempts. I'm talking about technology that is WAY in the past, so I'm assuming this will not violate MR's policies!)

Albert the ancient, who can sometimes be drawn off topic.
st_albert is offline   Reply With Quote
Old 03-26-2014, 03:16 AM   #11
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by roger64 View Post
I did not know there were such thing as "social DRM". I always thought they were totally wild...
Well, I call it social DRM. It is part of a product publishers use to create watermark ePUB I think instead of the normal DRM.
The book works, probably because the references in the HTML files are correct, but if you remove the watermark, files (images) will be missing and therefore cripple the book if you are not careful.
I found this out when I cleaned a book I purchased that contained various pictures.
Toxaris is offline   Reply With Quote
Old 03-26-2014, 04:01 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,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by st_albert View Post

Next, I've been playing with the files you posted, and first of all, if I convert the .odt file using the stand-alone writer2latex java program (the patch for LO didn't work for me), I don't get any embedded fonts at all. Maybe due to the fact that I don't have those fonts on my system, or due to the specific configuration I have created for writer2latex. (in general we do not embed fonts, so as to simplify our legal obligations.) So no joy there.
Thanks for all your infos.

The fonts are embedded not on the odt file (which one could do with LibreOffice) but by writer2xhtml which inserts both fonts and an external CSS stylesheet containing among others the @font-face declarations (it's named styles.css in the EPUB).

Quote:
Originally Posted by st_albert View Post

However, when I use the calibre ebook editor on your pristine epub, I do notice the fact that the fonts are not properly referenced. I edited not the book.opf file, but the styles.css file, and made the references to the font files match what was the real location of the files (e.g. src: url('../styles/LinLibertine_RI.otf'); and so on.
This pristine EPUB is not considered as finished. As I added an external stylesheet I have some adjustments to do. Also, on the corresponding calibre thread, Kovid Goyal gave me a very easy way to correct the EPUB (easy once you know it, but I had been unable to find it), just by renaming the font file and its path - and without tinkering uselessly with the manifest.

One of the very good things of the calibre Editor is that it has a very sharp eye and gives some more warnings that we did not find previously in Flightcrew and Epubcheck. Good to use.

Last edited by roger64; 03-26-2014 at 05:13 AM.
roger64 is offline   Reply With Quote
Old 03-26-2014, 04:05 AM   #13
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,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
Quote:
Originally Posted by eschwartz View Post
The actual location of resource files within an EPUB are arbitrary and hold no meaning or value, other than what we think about it. That being said, I agree with the idea they should be in the right location.

I requested this feature, and Kovid added it: you can now go to Tools ==> Arrange into folders, and specify where each type of file should go; the settings are sticky.
Good to know. Thanks for it.
roger64 is offline   Reply With Quote
Old 03-26-2014, 05:53 AM   #14
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
@roger64: BTW, there's a known bug in Sigil's FlightCrew that'll report unused resources, if the font embedding CSS code is defined in the <head>...</head> section of an .html file instead of a separate stylesheet.

I.e., Sigil expects font embedding code to be defined in a separate stylesheet, which is definitely a good idea in a principle, but not required for valid ePubs.

I haven't used writer2xhtml, but if it doesn't create separate stylesheets for embedded fonts, FlightCrew will generate an error, but ePubcheck shouldn't.
Doitsu is offline   Reply With Quote
Old 03-26-2014, 06:30 AM   #15
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,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
@Doitsu

Thanks for this info.
roger64 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
container.xml resource is missing masheen ePub 2 07-13-2011 10:36 PM
Referenced Resource missing from package dgbeig ePub 5 05-19-2011 03:08 AM
"referenced resource exists, but not declared" what fixes this? a-name4epub ePub 3 12-05-2010 01:12 AM
PRS-600 Package missing software? PennyPie Sony Reader 6 12-24-2009 06:05 AM
Deluxe package - missing items? machalla Bookeen 9 11-08-2007 01:36 PM


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


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