View Single Post
Old 04-01-2025, 01:48 PM   #928
Jaws
JCL Punch-Card Collector
Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.Jaws is out to avenge the death of his or her father, Domingo Montoya.
 
Posts: 84
Karma: 34468
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
Unit Inconsistencies

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.

When looking at the stylesheet of an ePub that has been converted from KFX:

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...

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.

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?
Jaws is offline   Reply With Quote