Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2025, 12:29 PM   #1
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
How to Use Justification Properly?

Since devices are getting higher and higher in resolution and software is getting better and better at hyphenation, so in my opinion it makes sense to consider justification for the main text. I've also seen that RbnJrg uses justification by default, and who am I to question that.

Nevertheless, I would like to know what you generally think about this and whether it would make sense to leave low-resolution devices left-aligned and if so, at which value the breakpoint is usually set nowadays (I personally tend to 768px).
Slevin#7 is online now   Reply With Quote
Old 07-15-2025, 12:38 PM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Slevin#7 View Post
Since devices are getting higher and higher in resolution and software is getting better and better at hyphenation, so in my opinion it makes sense to consider justification for the main text. I've also seen that RbnJrg uses justification by default, and who am I to question that.

Nevertheless, I would like to know what you generally think about this and whether it would make sense to leave low-resolution devices left-aligned and if so, at which value the breakpoint is usually set nowadays (I personally tend to 768px).
The resolution has nothing to do with justification and hyphenation. I would do full justification if there is hyphenation. Left justification if there is no hyphenation. But there's no way to know in code if there is hyphenation or not.
JSWolf is offline   Reply With Quote
Advert
Old 07-15-2025, 12:51 PM   #3
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
Quote:
Originally Posted by JSWolf View Post
The resolution has nothing to do with justification and hyphenation.
I agree that there is no direct connection, but devices with lower resolution, eg. smaller smartphones, tend to have less space for each line which results usually in less words which consequently leads to a less feasibility to get a nice word spacing on justification.

Ergo: low resolution -> less words per line -> ugly word-spacing on justification
Slevin#7 is online now   Reply With Quote
Old 07-15-2025, 01:25 PM   #4
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
How to Use Justification Properly? Don't.

Don't specify justification or lack of it, except where necessary (e.g. poetry and long titles are probably better not justified). Let the user set the default in their reading device/application, as with font size, margins, line spacing, etc. If the software is broken and doesn't allow it, too bad for them, don't break it for users with proper readers.
Jellby is offline   Reply With Quote
Old 07-15-2025, 01:52 PM   #5
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
Quote:
Originally Posted by Jellby View Post
Don't specify justification or lack of it, except where necessary (e.g. poetry and long titles are probably better not justified). Let the user set the default in their reading device/application, as with font size, margins, line spacing, etc.
So you mean I shouldn't even provide some default values for margin and line-spacing, although the user can override them manually? And justification as a default value could be overridden as well, at least all the readers I've tested so far are capable of.

But if that's the common way to go I will consider removing my 1em body margin as well...
Slevin#7 is online now   Reply With Quote
Advert
Old 07-15-2025, 02:12 PM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 31,056
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Every device I have has its internal Defaults (some also have user settings)
So there is no need to spec base Line spacing. Margins or Blockquotes.

Those should be specific overrides, where you want more or less than you get without the specific setting.
Places I force a large line space: Signs that may wrap to 2 lines and you want them further apart.
Danger<br />
High Voltage
theducks is online now   Reply With Quote
Old 07-15-2025, 02:16 PM   #7
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Slevin#7 View Post
I agree that there is no direct connection, but devices with lower resolution, eg. smaller smartphones, tend to have less space for each line which results usually in less words which consequently leads to a less feasibility to get a nice word spacing on justification.

Ergo: low resolution -> less words per line -> ugly word-spacing on justification
That depends on the font, the text size, and if hyphenation is turned on. I'm using BookFusion on my iPhone and ChareInk6SP. With the smaller space and hyphenation, I don't have too many gaps.
JSWolf is offline   Reply With Quote
Old 07-15-2025, 02:20 PM   #8
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Slevin#7 View Post
So you mean I shouldn't even provide some default values for margin and line-spacing, although the user can override them manually? And justification as a default value could be overridden as well, at least all the readers I've tested so far are capable of.

But if that's the common way to go I will consider removing my 1em body margin as well...
Don't specify the font size unless you want a font size larger then 1em. Don't specify line-height. Specify overall margins as 0. Specify widows and orphans at a value of 1. Do so in body and p. Don't have a chapter header take too much space as this is not a pBook.
JSWolf is offline   Reply With Quote
Old 07-15-2025, 02:32 PM   #9
Quoth
Still reading
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 14,033
Karma: 105092227
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
Quote:
Originally Posted by theducks View Post
Every device I have has its internal Defaults (some also have user settings)
So there is no need to spec base Line spacing. Margins or Blockquotes.
And actually on a lot of apps and ereaders:
Left & right margins can only be set larger, not smaller.
If line-height is set at all, then the user can't change it at all. The Font metrics automatically set a line-height, which the user can override.

The first top margin on a first new page (caused by file change) may be stripped, thus padding-top is better for something at the start of a file (normally one per chapter or similar division) and likely any bottom margin at the end of a file is stripped. But it depends on the app or ereader.

Blockquotes are a throwback to HTML3. They might be semantically appropriate for an actual quote, but for stanzas, preambles, quoted letters and many things simply an appropriate CSS for <p class="something-more-indented"> is better. Similarly automatic lists are tricky in HTML and are better as a paragraph style with inverted margins and manually entered indexes, which allows a gap and restarting at next number, whereas the auto HTML list in an ebook can usually only start at 1st index.
Quoth is offline   Reply With Quote
Old 07-15-2025, 03:51 PM   #10
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,549
Karma: 19500001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by Slevin#7 View Post
So you mean I shouldn't even provide some default values for margin and line-spacing, although the user can override them manually?
Exactly. But not "although" but "even if". A plain:

Code:
<body>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est
laborum.</p>
</body>
Will display with some line spacing, font size and margin (possibly 0), will it not? Then let the user decide what that should be and don't change it yourself.

Quote:
And justification as a default value could be overridden as well, at least all the readers I've tested so far are capable of.
That depends on the reader and how you specify it. And overriding styles (as opposed to setting a default) is more likely to break something else. How is the reader (software) supposed to know which properties/styles should be overridden and which not? It can only "guess", and guesses will fail sometimes.

PS. I'm guilty myself of specifying "p { margin:0; text-indent: Xem; }", but that's mostly so I can get something readable in a browser.
Jellby is offline   Reply With Quote
Old 07-15-2025, 08:56 PM   #11
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,766
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Slevin#7 View Post
Since devices are getting higher and higher in resolution and software is getting better and better at hyphenation, so in my opinion it makes sense to consider justification for the main text. I've also seen that RbnJrg uses justification by default, and who am I to question that.
Well, just because I do "something" doesn't mean that that "something" is right. At most, I can only say that "something" is right, but only for me.

But I'm going to defend my position. And I'm going to do so based on what's happening with Google Play Books and PocketBook ereaders (which I've seen from your comments that you use).

The following is a screenshot of an epub opened with GPB styled with my .css styles:

Click image for larger version

Name:	Screenshot_2025-07-15-21-09-57.png
Views:	25
Size:	167.1 KB
ID:	216925

What happens when I select from the GPB menu text-align to left? The following:

Click image for larger version

Name:	Screenshot_2025-07-15-21-10-27.png
Views:	27
Size:	166.5 KB
ID:	216926

As you can see, GPB aligns to the left ALL THE TEXT, not only the text in <p> tags but also text in <h*> tags. And what happens if I select justified text? The following:

Click image for larger version

Name:	Screenshot_2025-07-15-21-10-58.png
Views:	22
Size:	166.6 KB
ID:	216927

The text in <h*> tags remains aligned to the left. Now imagine the disaster that would occur if proper alignment weren't included, with paragraphs that should be aligned to the right or center? If you let users set the alignment, they won't get the best reading experience. By adding your own style, you give them a point of comparison between what they can get on their own and what the book can provide by default.

And the same thing happens in PB. The following screenshot is from another chapter in the same book, with the default styles:

Click image for larger version

Name:	Screenshot_2025-07-15-21-13-16.png
Views:	25
Size:	197.5 KB
ID:	216928

Now, PB is smarter than GPB and doesn't allow you to change the alignment unless the user disables the styles built into the .css file. What happens if you disable those styles and set the alignment to left? Well, this is it:

Click image for larger version

Name:	Screenshot_2025-07-15-21-14-25.png
Views:	26
Size:	251.4 KB
ID:	216929

Compare the reading experience with built-in styles and what users can achieve by disabling them.

One more thing: all my epubs are epub3 with fallback code for epub2. And all my epubs have hyphenation, regardless of whether the e-reader has that feature or not. This is because my epubs have "Hyphenator" built in, a JavaScript program that hyphenates words where necessary. If the e-reader has hyphenation, then Hyphenator doesn't run; if not, it does.

And finally, if the default alignment for <p> elements is justified or left-aligned, you have to consider the language. English is a language of short words, so even without hyphenation, justified text looks good (see the first screenshot, which belongs to GPB, with justified text and no hyphens—I should clarify that there are no hyphens there because GPB is an epub2 reader and doesn't support JS). On the other hand, German is a language of long words, and there, even with hyphens, you have to carefully analyze whether justified or left alignment is appropriate.

The behavior of GPB and PB is practically shared by most e-readers, so if users choose left-aligned text, they have to be prepared for the entire book, not just the body text, to have that alignment (imagine text that should be right-aligned with the opposite alignment; a real disaster).

And regarding font size, you might want to read the following articles:

https://www.w3schools.com/css/css_font_size.asp

https://developer.mozilla.org/en-US/.../CSS/font-size

https://developer.mozilla.org/en-US/...nt-size-adjust

Last edited by RbnJrg; 07-15-2025 at 09:08 PM.
RbnJrg is offline   Reply With Quote
Old 07-16-2025, 05:00 AM   #12
Slevin#7
Connoisseur
Slevin#7 began at the beginning.
 
Posts: 61
Karma: 10
Join Date: May 2025
Device: iPad
Quote:
Originally Posted by RbnJrg View Post
Now imagine the disaster that would occur if proper alignment weren't included, with paragraphs that should be aligned to the right or center? If you let users set the alignment, they won't get the best reading experience. By adding your own style, you give them a point of comparison between what they can get on their own and what the book can provide by default.
Yes, that's exactly my point of view. Most of our target readers (the real people in front of the reading devices^^) use apps (no matter which app, but in this case here the reading app) with settings predefined by the app. They don't delve into the depths of configurations to pimp their reading experience, they just don't.

As a software developer I've had this to learn as well, namely that users just take what they get and as a last ressort, at a point where they get really bothered by something, they seek for a solution. So give them a best possible base point, since even if they could get a better experience manually, most of them never will.

But I'll get it with line-height, in contrast to websites it seems better to not set them for ebooks. And the overall margin 0 for the body element hat no effect on the readers I've tested (except Sigil's inbuilt reader, which has no presettings at all).

@RbnJrg
Is there a way I could get one of your ebooks or CSS to study you approaches? You seem to have great experience, and only looking at the screenshots you provided here I have multiple followup questions^^. But if your'e not comfortable don't bother, I've already learned at lot from you and say thanks for all that valuable information.
Slevin#7 is online now   Reply With Quote
Old 07-16-2025, 07:45 AM   #13
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,766
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Slevin#7 View Post
@RbnJrg
Is there a way I could get one of your ebooks or CSS to study you approaches? You seem to have great experience, and only looking at the screenshots you provided here I have multiple followup questions^^. But if your'e not comfortable don't bother, I've already learned at lot from you and say thanks for all that valuable information.
I will answer you by PM.
RbnJrg is offline   Reply With Quote
Old 07-18-2025, 02:23 PM   #14
nabsltd
Fanatic
nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.nabsltd ought to be getting tired of karma fortunes by now.
 
Posts: 521
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
Quote:
Originally Posted by Jellby View Post
If the software is broken and doesn't allow it, too bad for them, don't break it for users with proper readers.
From what I have found, every device that allows users to pick between ragged-right and fully-justified can do so regardless of how the underlying text is formatted.

For that reason, I format the text with what I would like users to see if they have no choice. In other words, there is no way to please every user if they all use devices that don't allow changing justification, so picking one is no worse than not picking one (somebody will be upset regardless of your choice).
nabsltd is offline   Reply With Quote
Old 07-18-2025, 02:25 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,756
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Most people prefer justified. So go with that. They can change it either in the CSS or in the options if there is such.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Troubleshooting Justification sillypoint Amazon Kindle 10 03-21-2013 11:09 PM
PRS-T1 Justification treadlightly Sony Reader 4 12-14-2011 01:21 PM
PRS-T1 Justification Hatgirl Sony Reader 5 11-17-2011 09:59 AM
Justification Georgiegirl2012 General Discussions 21 09-27-2010 09:38 AM
DX justification jlinden Amazon Kindle 7 01-18-2010 07:22 AM


All times are GMT -4. The time now is 04:29 PM.


MobileRead.com is a privately owned, operated and funded community.