Using Amazon's Kindle Previewer I took a look at the HTML and CSS provided and saw the same result, with the first paragraph not justified. I dug into the cause of that and it appears to be the consequence of several things related to how Amazon has implemented Enhanced Typesetting (KFX format) in conjunction with some unusual formatting choices made in this book.
First is that Amazon attempts to normalize the font size of books so that the main body text is the same across all books they sell. The CSS of that book sets the body text to 0.719em by wrapping the text in spans with font-size set to that. The KFX conversion attempts to compensate by essentially adding an outer div with a font-size of 1.39082em so that the resultant rendered size is 0.719 * 1.39082 = 1em. However this change triggers unexpected behavior in the KFX renderer.
Most of the paragraphs in the sample contain a single span encapsulating all of the text. In those cases the conversion to KFX folds the styling from that span into the paragraph so that the overall text-size of the paragraph is 1em.
But the paragraph that is handled incorrectly has the text is spit into two spans, each setting the text size to 0.719em. So in that case the renderer cannot fold the spans into the paragraph leaving the text-size at the paragraph level as 1.39082em.
In regular HTML the font-size at the paragraph level does not matter. But in KFX Amazon tries to be clever and disables text justification for a paragraph if the font-size exceeds a certain limit. This often results in a more readable rendering when the publisher has chosen to make something in the book much larger than normal. However in this case it appears that this logic is being triggered unexpectedly because of Amazon's compensation for the unusually small font size chosen for the book.
|