Quote:
Originally Posted by Jaws
I'm encountering three different kinds "unit inconsistencies" in KFX --> ePub; they may be unrelated, they may be due to KFX itself, to the KFX Input plugin, or something in Calibre's own conversion process. Or, I suppose, in something else entirely.
|
These inconsistencies will likely have multiple causes: the formatting supplied by the publisher, Amazon's conversion of that to KFX, this plugin's conversion of KFX to EPUB, and calibre manipulation of that EPUB. There is no effort made to maintain the sort of consistency that you would like in this process.
Quote:
Originally Posted by Jaws
1. "Line height" is inconsistently "unitless" in heavily-illustrated books (and this includes, sometimes, tables of data that were embedded as a graphic). In the stylesheet (usually stylesheet.css), some styles will contain each of the following (all of which are/should be valid ePub characteristics):
line-height: 1.29017;
line-height: 129.017%;
line-height: 1.29017em;
This bugs me; it's inconsistent with good laboratory practice — and ability to maintain files over time. It has bugged me about the graphic-design community for several decades, so it may have nothing whatsoever to do with Calibre or any plugin or even KFX.
The reason that I think this may be Calibre is that the first one (the purely unitless one) only appears in "line-height" and margin/padding, never in font size or text-indent. This is a "I'm trying to understand" thing more than a bug report; but...
|
You can compare various versions of the book if you want to see what changes were introduced by each step. However that could be a lot of work.
The "From KFX" toolbar action can be used to bypass calibre's part of the conversion process to see the CSS produced by this plugin. That will not match exactly the content of KFX format since KFX actually uses something similar to but not the same as HTML/CSS.
To see the actual KFX content in human readable form use the --unpack option of the command line interface supplied by this plugin. "Creating a symbol catalog file" in the first post of this thread has steps needed before this can be accomplished. Making sense of the result is not easy since KFX is undocumented.
You can come close to seeing what the publisher provided to Amazon by obtaining the book in KF8/AZW3 format, available using some older kindle models and apps, and then converting that to EPUB using the KindleUnpack plugin.
Quote:
Originally Posted by Jaws
2. Conversion to different kinds of margin (and padding) shorthands in the ePub stylesheet seems completely random, even within the same book. One might find all of the following in the same ePub stylesheet (I just did this morning):
margin: 0 0 6.24399%;
margin-left: 6.24399%;
margin-left: 0.5em;
margin: 0 0 0 6.24399%;
This one is closer to a bug report than item 1, but the code still "works" so maybe it's not a true "bug." It is in all probability related, somehow, to "what font was specified in the KFX file, whether that font was embedded, and whether that embedded font was subsetted (possibly who subset it, too)." But it's puzzling; specifically, what's puzzling is which form for {editorial comment: STOOOPID choices in the CSS specification for "shorthands", so definitely not a Calibre issue} stating the "margin" is chosen.
|
This plugin will not produce a margin property with multiple values since there is no KFX equivalent to that. That combining of individual margin-xxx properties must be due to calibre.
Quote:
Originally Posted by Jaws
3. Where, oh where, does the "this book sometimes specifies percentages and sometimes specifies ems" business come from? Is there a way to force conversions to choose one or the other?
|
Those are two different things that have no equivalent conversion. Percent is used for dimensions that should scale with the size of the containing block and ultimately the size of the screen. em is used when the dimension is intended to scale with the font size chosen by the reader. Both are needed for different cases.