View Single Post
Old 05-07-2021, 09:08 PM   #34
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by jackie_w View Post
Perhaps you didn't look hard enough. Every <span> with class="CharOverride-4" is italic. There are hundreds of those.
Hence the more surgical approach—deleting known useless style info (absolute positioning), then Calibre EPUB->EPUB conversion.

It's how I typically deal with really atrocious InDesign->EPUBs or Google Docs->EPUB. (If you think InDesign is bad, you should see Google Docs's code!)

Note: Like a few InDesign oddities I've been running across lately:

In some files, InDesign assigns an "Italic" font, but uses "font-style: normal" within the CSS.

So in a clean document, it should look like this:

Code:
<p>This is an <i>italic</i> word.</p>
but InDesign->EPUB may appear like this:

Code:
<p>This is an <span class="CharOverride-4">italic</span> word.</p>
Code:
span.CharOverride-4 {
	font-family:"Minion Pro Italic";
	font-style:normal;     <----- See here. Should say italic.
	font-weight:normal;
}
I'm unsure of how/why...

I've also run across similar in some DOCXs I've gotten from authors. Toxaris's EPUBTools doesn't handle these types of wrongly-styled fonts properly, but he is aware of the issue (and I believe he was working on it for the next release).

If you just mass throw away <span>s/fonts without looking closely, you'd also lose this sort of information.

Last edited by Tex2002ans; 05-07-2021 at 09:18 PM.
Tex2002ans is offline   Reply With Quote