![]() |
ebook-convert cuts svg styles: what can I do?
For example, the HTML:
Code:
<!doctype html>I mean, literally looses it, the converter cuts it out (not in stylesheet any more), so the SVG is not styled correctly. What can I do with it? |
Oh, and the ebook-convert log, as required when asking a question (but everything's normal here)
Code:
iliakan> /Applications/calibre.app/Contents/MacOS/ebook-convert book.html book.epub --embed-all-fonts --max-toc-links 0 --level1-toc '//h:h2' --level2-toc '//h:h3' |
Quote:
bernie. |
When I add the rule manually rezipping the epub, everything's fine (iBooks).
Check it out: http://ilyakantor.ru/b.epub.zip The problem is that the rule is *removed* from CSS completely by ebook-convert. What da .... ?!? It's my styles man! I'm really struck by that. |
1 Attachment(s)
Quote:
Code:
WARNING: CSS: Property: Unknown Property name. [9:3: fill]****[stylesheet.css]Spoiler:
bernie |
I added the "color" property to the style of the original HTML-document above:
Code:
.link {So the "strange properties" is probably not the issue. I opened the hand-fixed http://ilyakantor.ru/b.epub.zip in Calibre, iBooks, Sigil, all 3 programs programs show it well. That's the screenshot from Sigil: http://ilyakantor.ru/screen/2015-01-24_0054.png (the path is styled correctly). So "unsupported properties" is not an issue too here, just because all 3 readers are fine with it. What remains is a converter issue. Maybe that's because the converter adds svg: namespace to the svg tag and inside it, and things become messed up? |
2 Attachment(s)
Quote:
Spoiler:
bernie |
If one removes the offending properties, the CSS becomes valid, but the conversion issue still exists as you can see looking into the epub source (the rule disappears).
|
Using css to style svg is not supported by the ebook-convert (and is not supported by most ebook reading software either). I think the only exceptions are iBooks and browser based ebook renderers like calibre itself, or Sigil (which all use versions of WebKit). I might look into adding support for it someday, but it isn't a priority, patches are welcome.
And note that since epub requires xhtml not html 5, adding the svg: prefix is a must. |
Maybe it could be a great move to enable svg rasterizer then?
I know it's done for some formats, but not for ebook. If I have a CSS-styled SVG, then must rasterize it to show up correctly everywhere, right? |
Since the vast majority of svg images dont use css for styling, I'm not particularly interested in implementing rasterization, once again, patches are welcome.
|
| All times are GMT -4. The time now is 10:39 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.