04-13-2022, 08:24 PM | #1 | |
Guru
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:
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; } Code:
font-feature-settings: "liga" 0; Can anyone explain why the Editor doesn't like that line? What's it supposed to be doing? |
|
04-13-2022, 09:18 PM | #2 |
Resident Curmudgeon
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?
|
Advert | |
|
04-13-2022, 09:29 PM | #3 |
Bibliophagist
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.
|
04-13-2022, 10:57 PM | #4 |
Guru
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 |
04-14-2022, 12:33 AM | #5 |
Bibliophagist
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> Not to mention the <br class="calibre1"> being used to break paragraphs which are not present in my copy of the ebook. |
Advert | |
|
04-14-2022, 08:47 AM | #6 |
Resident Curmudgeon
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. |
04-14-2022, 09:41 AM | #7 |
Guru
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.
|
04-14-2022, 11:36 AM | #8 |
Guru
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? |
04-14-2022, 12:00 PM | #9 |
Bibliophagist
Posts: 35,839
Karma: 145624992
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
|
04-14-2022, 12:04 PM | #10 |
Guru
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. |
04-14-2022, 01:15 PM | #11 |
Resident Curmudgeon
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 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.
|
04-14-2022, 03:55 PM | #12 |
Addict
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. |
04-14-2022, 04:12 PM | #13 | |
Resident Curmudgeon
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:
|
|
04-14-2022, 04:13 PM | #14 |
Guru
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. |
04-14-2022, 04:23 PM | #15 |
Resident Curmudgeon
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.
|
|
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 |