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 04-13-2022, 08:24 PM   #1
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Don't Understand Error Message: ... but found '"liga" 0'

I have almost no knowledge of CSS. I'm using the Editor in Calibre on an epub I own and ran the bugcheck function on it. It's given me 8 errors that are basically the same thing for different places of CSS:

Quote:
ERROR: Expected (<feature-tag-value> | normal) but found '"liga" 0'.****[stylesheet.css]
That one points to the 6th line of the following (the second occurence of "liga"):

Code:
.char-of-normal {
  -webkit-font-feature-settings: "liga" 0;
  -webkit-font-kerning: Normal;
  -webkit-font-variant-ligatures: no-common-ligatures;
  font-family: "Times New Roman", "TimesNewRomanPSMT", "Times", "serif";
  font-feature-settings: "liga" 0;
  font-kerning: Normal;
  font-size: 0.75rem;
  text-decoration: none;
}
Here's the specific line pulled out of the above:

Code:
font-feature-settings: "liga" 0;
Following the help link doesn't really tell me much. But, if I search for that line, I come up with pages showing it as valid CSS. Also, 4 lines above it is almost the identical line (except it's prefixed with "-webkit-") and it doesn't have a problem with that.

Can anyone explain why the Editor doesn't like that line? What's it supposed to be doing?
enuddleyarbl is offline   Reply With Quote
Old 04-13-2022, 09:18 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,304
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
What version of the ePub is it? Is it ePub 2 or ePub 3?
JSWolf is offline   Reply With Quote
Advert
Old 04-13-2022, 09:29 PM   #3
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,839
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
It may be valid CSS for a web browser but is it valid CSS in an ePub2 or ePub3 which use subsets of CSS2 and CSS3 respectively. I ran your snippet through the W3C online validator. For Epub3/CSS 3, it commented about the multiple vendor extensions (the -webkit-font-whatver lines), for ePub2/CSS2.1, it not only complained about the vendor extensions but added 3 errors (2 about settings that don't exist in CSS2.1, one that complained about the use of rem which not valid in CSS2.1. You may want to start using ePub3 if you need to make use of those features. OTOH, anyone who uses Times New Roman in an ebook is a hopeless romantic.

Click image for larger version

Name:	W3C_Check_CSS2.png
Views:	82
Size:	94.8 KB
ID:	193219
DNSB is offline   Reply With Quote
Old 04-13-2022, 10:57 PM   #4
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Supposedly, the book is in ePub2. It's Roger Zelazny's 1965 book "This Immortal" which I bought in Kindle format from Amazon something like 8 years ago. I'm working with the Calibre converted epub. Again, I'm almost entirely clueless about CSS. I'm trying to improve the way it looks as a learning experiment, but the CSS/HTML just looks awful to me. For instance, it looks like almost every paragraph is part of a <div id=...> statement. Which, in my ignorance, seems to imply it wants to make every paragraph a unique object to, perhaps, be manipulated with Javascript (?). And, I can't make hide nor hair of what it's doing with all the paragraph and character style statements that it strews everywhere.

I'm going to attach a link to a Scrambled version of the book. If anyone has the time, ability and/or inclination to look at it, perhaps you can tell me what's going on with the CSS. For instance, part0005.html has one line of text on it and dozens of commands all down the page. I have no idea why. And, later, in the actual text, you can see how bad the formatting looks because of all the styles stuck in the middle of everything. I'm wondering if the only way to make it "better" would be to delete all the stylesheet stuff and try making it all up myself.

https://drive.google.com/file/d/1Z1e...ew?usp=sharing
enuddleyarbl is offline   Reply With Quote
Old 04-14-2022, 12:33 AM   #5
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,839
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Taking a quick look at the file, it's a mess. If you have the original Amazon copy and it is KF8/azw3, I would suggest using KindleUnpack to recreate the epub file instead of using calibre to convert to epub. If it was mobi, you are kinda stuck with that mess.

Looking at items such as:
Code:
      <div id="box1_1201" class="para-normal">
<span class="char-of-normal"><br class="calibre1"/>
</span>
</div>
generating a blank line where a simple <p>& # 160;</p> would have pretty much the same effect.

Not to mention the <br class="calibre1"> being used to break paragraphs which are not present in my copy of the ebook.
DNSB is offline   Reply With Quote
Advert
Old 04-14-2022, 08:47 AM   #6
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,304
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I don't know who made This Immortal into an eBook, but just looking at the preview on Amazon, it's terrible. It's inconsistent. The line spacing is all over the place.'

It's no wonder the code is rather poor. But yes, I agree to shift to ePub using KindleUnpack and see what sort of code you get.
JSWolf is offline   Reply With Quote
Old 04-14-2022, 09:41 AM   #7
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Since I bought this about 8 years ago, I'm guessing the original was mobi. But, I downloaded a fresh copy from Amazon about 10 months ago when I switched over to Kobo and that's an azw3. I'll head on back, get an even fresher version and see what I can find about/with KindleUnpack. Thanks for the help. I'll report back.
enuddleyarbl is offline   Reply With Quote
Old 04-14-2022, 11:36 AM   #8
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
OK. It took me a while to get myself connected back to Amazon. But, I got a fresh copy of the azw3 and used KindleUnpack to unpack it. Opening that epub (and the azw3) in the Calibre editor shows it to still be the same kind of mess.

I guess I'll do something like noting the styles used in the stylesheet.css, removing most of them, seeing what I can do about those <div id=...> things and then creating and applying a couple of reasonable styles to the text. I wonder if I could find/generate just the text and start with that. It might be easier.

Also, on a semi-related note, if I add the KindleUnpacked version of the epub into Calibre, will it replace the ORIGINAL_EPUB or the EPUB format?
enuddleyarbl is offline   Reply With Quote
Old 04-14-2022, 12:00 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,839
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by DaveLessnau View Post
Also, on a semi-related note, if I add the KindleUnpacked version of the epub into Calibre, will it replace the ORIGINAL_EPUB or the EPUB format?
The EPUB format.
DNSB is offline   Reply With Quote
Old 04-14-2022, 12:04 PM   #10
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Thanks, again.

Maybe I'll play around with Calibre's Convert Books function and see if it can do something programmatically with the azw3. That might give me a better starting point.
enuddleyarbl is offline   Reply With Quote
Old 04-14-2022, 01:15 PM   #11
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,304
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DaveLessnau View Post
Thanks, again.

Maybe I'll play around with Calibre's Convert Books function and see if it can do something programmatically with the azw3. That might give me a better starting point.
I don't think there's much you can do. The best solution is to hand edit the code in the Calibre editor. Start off by removing excess CSS (tools menu) and go from there. Also install the epubcheck editor plubin and use both the Calibre ePub checker and epubcheck to find any errors that need to be fixed.
JSWolf is offline   Reply With Quote
Old 04-14-2022, 03:55 PM   #12
retiredbiker
Addict
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 388
Karma: 1638210
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
It was some books like this that got me started learning the editor and how these ebooks really work. And how simple they should be. It's a mystery how people even manage to build some ebooks, I can't imagine the tools that create such a mess, or why.

One like this, I'd take the dynamite approach and edit the html and css down to one or two very simple styles, remove all ids and <span>s, and change all those <div>s to <p>s. Great learning exercise if you want it. The other dynamite way is to convert the thing to txt, clean it up using paragraph styles in Writer or Word and convert from there. It's just a plain simple novel, so not much styling is needed.
retiredbiker is offline   Reply With Quote
Old 04-14-2022, 04:12 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,304
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by retiredbiker View Post
It was some books like this that got me started learning the editor and how these ebooks really work. And how simple they should be. It's a mystery how people even manage to build some ebooks, I can't imagine the tools that create such a mess, or why.

One like this, I'd take the dynamite approach and edit the html and css down to one or two very simple styles, remove all ids and <span>s, and change all those <div>s to <p>s. Great learning exercise if you want it. The other dynamite way is to convert the thing to txt, clean it up using paragraph styles in Writer or Word and convert from there. It's just a plain simple novel, so not much styling is needed.
I find it easier to start with the eBook and edit it from there. It's a lot easier then trying to figure out where to put things like bold, italic, small caps, offset text, etc. So converting to a text file should be right out.
JSWolf is offline   Reply With Quote
Old 04-14-2022, 04:13 PM   #14
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
I've got most of the weird character styles merged and/or deleted. Now, I'm trying to figure out how to get rid of the <div id=...></div> things. I guess if I assume there aren't nested divs within them, I won't have to worry about the </div> tag being for the wrong starting <div> and a regex search/replace would work.

And, after looking more closely at things, along with every paragraph being set as a block with <div id=...>, it looks like they're additionally set as a block with "display: block;" inside the paragraph styles.
enuddleyarbl is offline   Reply With Quote
Old 04-14-2022, 04:23 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 74,304
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
@DaveLessnau Would you mind shifting from KF8 to ePub using KindleUnpack and then scrambling it and posting so we can see the original code? Thanks.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't understand how to use "Automatic adding" Pierre-Olivier Library Management 0 10-14-2013 08:34 AM
"Error importing EPUB. EOCD not found. Not a ZIP archive? (Error Code 1068)" oren Android Devices 1 02-20-2012 04:10 AM
Seriously thoughtful I still don't understand "tea". kindlekitten Lounge 20 06-04-2010 05:36 AM
I don't understand meta data "Series" Imatechie2006 Calibre 6 01-03-2010 03:08 AM


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


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