View Single Post
Old 08-20-2023, 05:19 AM   #1
Zillion_
Enthusiast
Zillion_ began at the beginning.
 
Posts: 29
Karma: 10
Join Date: Jul 2023
Device: KindleOasis10thGen
KFX: centered 'transition' too much to the left

Hello,

another KFX-weirdness on the Kindle.
I use an EM Dash as a character for Transitions / Scene Breaks.

On the Kindle Reader using KFX format e-books, the dash is always about 1 cm too much to the left (see screenshot) if I set negative margins (more on that below).
No such problem with AZW3 or the Calibre viewer.
Even if the EM Dash is in a blockquote with other text that is properly centered, the dash itself is about 1 cm to the left of the center.
No text indents, no padding, etc.

After some playing with settings I noticed the following:

- confirmed: issue only appears with KFX format on Kindle. You can't see it with AZW3 files, nor in the Calibre viewer.

- issue appears when I use negative margins on body text during conversion from ePub to KFX (I do this to reduce the way-too-large-for-me Kindle default margins which really annoy me).

- same issue if I use other characters
- the issue doe NOT occur, however, with full paragraphs of text used e.g. in a Chapter intro, quotes or poems. They are all centered correctly.
- I first though the issue did not affect "<hr>" lines, but it does -- only less strongly - they move less far to the left and only when I set stupidly low negative margins, not my normal "-1.5".

- code for negative margins during conversion ("extra CSS"):

Code:
.calibre {
  display: block;
  padding-left: 0;
  padding-right: 0;
  text-align: justify;
  margin: 0;
  text-indent: 0;
  font-size: 1em;
  margin-left: -1.5em !important;
  margin-right: -1.5em !important;
}
.Body {
  display: block;
  text-align: justify;
  text-indent: 0;
  margin-top: 0.3em;
  margin-bottom: 0.3em;
  font-size: 1em;
}
This code applies negative margins to the "calibre" class, which is applied through the <Body class="calibre"> tag on each page.

Screenshots attached:
- result with margin-left and margin-right in Extra Css set to 0
- with -2.5
- with -5.5
- with -5.5 in AZW3 format: which results in "0", because the negative margins through this method don't work in AZW3 at all...

Please note that the centered text lines are not affected by this bug.
Use the Kindle clock above each screenshots as a reference for where the center should be.


Anybody got any idea why this happens, and if there could be a workaround ?

p.s. I'd rather not use images as scene breaks, because they cause the whole Kindle screen to flash (full page refresh). I've tried other text characters instead of the EM Dash, to no avail.

p.p.s. The trick with setting negative L&R margins through Extra CSS on the "calibre" tag only works with KFX, not with AZW3, and is one of the reasons I try to stick to KFX, the other being the hyphenation, X-ray, Wordwise and "about this book" features.
Attached Thumbnails
Click image for larger version

Name:	margins_0.png
Views:	149
Size:	54.8 KB
ID:	203230   Click image for larger version

Name:	margins_-2.5.png
Views:	122
Size:	53.5 KB
ID:	203231   Click image for larger version

Name:	margins_-5.5.png
Views:	149
Size:	52.9 KB
ID:	203232   Click image for larger version

Name:	margins_-5.5_AZW3.png
Views:	134
Size:	61.5 KB
ID:	203233  
Zillion_ is offline   Reply With Quote