![]() |
#1 |
Enthusiast
![]() 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;
}
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. |
![]() |
![]() |
![]() |
#2 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Jul 2023
Device: KindleOasis10thGen
|
I've actually found a sort of workaround using the following code for my Transitions or Scene Breaks:
Code:
<div style="margin-left:1em;margin-right:1em;text-align:center;margin-top:1.5em;margin-bottom:1.5em"> — </div> ![]() |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,071
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
I did some testing and I can verify that the KFX renderer has a bug that sometimes causes centered text to be rendered off-center if the block element is styled with negative left and right margins. The problem is worst with short text and large negative margins.
In the attached example all of the lines text should be centered. As the length of each line increases the centering becomes more accurate. This is not a problem with conversion to KFX. The formatting in the KFX file is correct. It is the KFX reading software that is failing to center the text properly. I doubt Amazon is going to do anything to fix this since this situation does not come up with books that are properly formatted for publishing. Last edited by jhowell; 08-25-2023 at 05:46 PM. |
![]() |
![]() |
![]() |
#4 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,752
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
html { margin-right: -45px; margin-left: -45px; break-inside: avoid !important; } |
|
![]() |
![]() |
![]() |
Tags |
kfx kindle center margins |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Left alignment with centered images | shoelesshunter | Kobo Reader | 0 | 10-18-2019 03:22 PM |
KFX to KFX to remove DRM | Tomifonication | Conversion | 12 | 08-09-2018 01:32 PM |
centered title page and chapter numbers display left in epub | JohnMurphy99 | Introduce Yourself | 1 | 06-04-2017 06:33 AM |
Centered but left align? | mtrahan | ePub | 15 | 04-01-2012 03:56 PM |