![]() |
#1 |
Enthusiast
![]() Posts: 43
Karma: 10
Join Date: Mar 2016
Device: Ipad mini 2
|
Full justify text issue
Hi there. I have formatted an ebook and have some justification issues which I'm trying to resolve in Sigil. Some of the first paragraphs or sentence from the start of some of the chapters is left justified but I can't seem to solve. see attached 2 screen shots.
first one is a view of chapter 1 which is correct full justified and what I want. 2nd one is a view of chapter 2 with the first line/paragraph not full justified. (left is the kindle view and right is the sigil view) haven't had this issue before. if someone can help me to overide this issue I would be grateful. ![]() David Last edited by ebookscovers; 12-11-2023 at 07:13 AM. Reason: added xhtml and css |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
We would need to see the xhtml and the css stylesheet to say why this is happening.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 43
Karma: 10
Join Date: Mar 2016
Device: Ipad mini 2
|
I have added the css and xhtml details
|
![]() |
![]() |
![]() |
#4 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,019
Karma: 5449552
Join Date: Nov 2009
Device: many
|
I see nothing obvious but controlling the letter spacing (sometimes negative!) and kerning and mixing css stylesheets with styles in the head tag and styles attributes directly on the tag is asking for trouble. Not to mention wrapping each paragraph in a div that may have its own styles.
There is one tool in Sigil that might give us a hint. In Sigil's Preview show the problem area. Then invoke Preview's Inspector tool and highlight the problem span and it will show the css properties of that block including where each property came from. That should give you a hint to see if really a justification issue or if the right margin setting or padding is incorrect, or is the containing div's width is the issue and where that property setting is inherited from. Last edited by KevinH; 12-11-2023 at 08:38 AM. |
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
What are you using to preview the content? The screenshots you include are not of Sigil's Preview window.
I ask because after importing your html and css into Sigil, Sigil's Preview shows the content in question fully justified. It is your external renderer that seems to be having the problem. EDIT: Never mind. I just noticed that you said the left images are views on a Kindle. We can't guess which portion(s) of your extensive css is not being properly honored by the conversion to the Kindle format. That's not really our area of expertise, or concern. Last edited by DiapDealer; 12-11-2023 at 09:59 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Moving this to the Workshop forum as this is not a Sigil issue. It is rather, a conversion issue regarding supported css. Perhaps others can provide insight into what sort of css does not convert well to other formats.
Last edited by DiapDealer; 12-11-2023 at 10:01 AM. |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
|
Class (para-Normal-Local-13) is your regular paragraph text and its justified for all the <p> tags except the first paragraph which uses "para-Normal-Local-7" tag for that.
A <span> class (char-Normal-Local-75) effects all of the other above mentioned <p> tags, and its NOT effecting nor reversing any of the 'justify' settings. Neither the inline CSS nor the external linked CSS indicate that the justify on <p> tags is being negated. When I looked at it on Firefox Developer screen it renders as "justify". There are three CSS elements set with 'text-align:right' -- but none of those are being used in that HTML doc page. If you add a sentence or two of "Ipsum Loren" test text you'll see the first paragraph's justify effect more readily. Summation: You have "justify" correctly set in <p>. Last edited by azimuth; 12-11-2023 at 11:02 PM. |
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 27,818
Karma: 198099188
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
That's the conclusion I came up with as well. So it must come down to being converted to a kindlebook that's causing the issue. I would simplify the ccs as much as possible before converting. If it converts and displays properly, "complicate it" little by little until it displays improperly after conversion. Then you'll have your culprit.
Also consider reading the Kindle publishing guidelines in order to determine if everything you're doing in your epub is even supported for kindlebooks. |
![]() |
![]() |
![]() |
#9 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,658
Karma: 85000001
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
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. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
trying to get text to justify | Clio | Conversion | 26 | 09-02-2022 08:24 AM |
Forced line breaks and full justify | dougfetch2 | ePub | 26 | 08-02-2017 12:11 PM |
How to automatically justify text? | cptnemo | Recipes | 9 | 11-27-2013 08:42 PM |
Can you left justify text with the 360? | maxbookworm | PocketBook | 11 | 05-31-2010 10:49 AM |
Problems getting text to justify | ficbot | Calibre | 4 | 01-13-2010 02:27 PM |