Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 09-28-2018, 04:08 AM   #1
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
text-align: initial; -- ??

I was restyling an epub3 file and wanted to change the text alignment.

So just did
p{ text-align:justify;}

Viewing the epub, it's justified.

Converted to AZW3 using Kindlegen, the text is left justified on my PW3.
Cannot be changed.
Hair-pulling ensues.

I used the Calibre viewer on the AZW3 and its inspector shows me that
text-align: initial;
is having an effect.
I find that at the end of the css, in media queries:

Code:
@media amzn-kf8 {
    body {
    	margin-left: 0.00em;
    	margin-right: 0.00em;
    	text-indent: 0.00em;
    }
    p { /*new  requirements for device adjustable line spacing*/
        text-align: initial;
    }
So I can just delete this.
But why is it here?
The comment states it's necessary for linespacing, but I can adjust linespacing in Kindle regardless on any azw I have.

What does "initial" mean anyway?
Where is the "initial justification" defined? Is it different for each device, reader?

Is this code actually useful in some situation? Seems to cause more trouble than it could solve.

Last edited by AlanHK; 09-28-2018 at 04:10 AM.
AlanHK is offline   Reply With Quote
Old 09-28-2018, 08:31 AM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
In CSS "initial" is equivalent to the default value for the property, which is "left" for text-align (for left-to-right text).

Forcing left aligned text seems like a bad idea and the comment in the CSS makes no sense to me.
jhowell is offline   Reply With Quote
Old 09-28-2018, 10:27 AM   #3
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by jhowell View Post
Forcing left aligned text seems like a bad idea and the comment in the CSS makes no sense to me.
I haven't seen any other books using this, or seen any advice to, but wondered if there was some new Amazon edict I had missed.

Seems more like someone misread something.
AlanHK is offline   Reply With Quote
Old 10-02-2018, 11:42 AM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by AlanHK View Post
I was restyling an epub3 file and wanted to change the text alignment.

So just did
p{ text-align:justify;}
FWIW, you're not actually supposed to set this to justified for MOBI, either. Just a comment....

Quote:
Viewing the epub, it's justified.

Converted to AZW3 using Kindlegen, the text is left justified on my PW3.
Cannot be changed.
Hair-pulling ensues.
Not to be pedantic, but "left justified" doesn't actually exist. That's left-aligned or ragged-right. Justified has a single meaning--which is straight edges on both sides. I know, it's quibbling, but for the purposes of clarity, I thought I'd mention that.

A comment about software/typography/MS:

Spoiler:
I also know that Microsoft contributed to this silliness, with their phrases in Word for alignment, e.g., "right justified" and "left," but truly, in typography, that doesn't exist.


Quote:
I used the Calibre viewer on the AZW3 and its inspector shows me that
text-align: initial;
is having an effect.
I find that at the end of the css, in media queries:

Code:
@media amzn-kf8 {
    body {
    	margin-left: 0.00em;
    	margin-right: 0.00em;
    	text-indent: 0.00em;
    }
    p { /*new  requirements for device adjustable line spacing*/
        text-align: initial;
    }
So I can just delete this.
But why is it here?
The comment states it's necessary for linespacing, but I can adjust linespacing in Kindle regardless on any azw I have.
On which devices are you saying that you can adjust line-spacing? Do you mean manually? Do you mean via coding? As far as I know, trying to manually adjust line-height is pretty much only doable in K4PC/Mac and the newest K10 Fire. I certainly can't do that on any other device in our collection, which is fairly extensive, from PPWs to Voyages to Fires to iPads with K4iPad on them, and the aforementioned K10 (and of course, my much-loved ancient K2).

Quote:
What does "initial" mean anyway?
Where is the "initial justification" defined? Is it different for each device, reader?

Is this code actually useful in some situation? Seems to cause more trouble than it could solve.
As jhowell said, it's supposed to be what it sounds like--the initial, or default, coding for an element, prior to any changes via coding. It's for pretty much anything, not just alignment, AFAIK.

What's bizarre, though, @jhowell, is, isn't initial supposed to be overridable? Designed to be? Not act as the override itself? Or am I wrong about that?

Hitch
Hitch is offline   Reply With Quote
Old 10-02-2018, 04:01 PM   #5
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Quote:
Originally Posted by Hitch View Post
As jhowell said, it's supposed to be what it sounds like--the initial, or default, coding for an element, prior to any changes via coding. It's for pretty much anything, not just alignment, AFAIK.

What's bizarre, though, @jhowell, is, isn't initial supposed to be overridable? Designed to be? Not act as the override itself? Or am I wrong about that?
In the CSS specification for text-align "initial" is defined as:
a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'

So for left-to-right text a CSS property declaration of "text-align: initial" is equivalent to "text-align: left". There is nothing in the specification about it being treated differently in terms of being overridable.

For books in KFX format (Enhanced Typesetting), Amazon allows the user to override the alignment of justified text to be left-aligned instead. That is independent of the CSS used AFAIK.

Last edited by jhowell; 10-02-2018 at 04:45 PM. Reason: typo
jhowell is offline   Reply With Quote
Old 10-02-2018, 11:26 PM   #6
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
Quote:
Originally Posted by Hitch View Post
FWIW, you're not actually supposed to set this to justified for MOBI, either. Just a comment....
Why not? Anyway, it works and I do it in all my books, including ones on Amazon for several years.

Quote:
Originally Posted by Hitch View Post
Not to be pedantic, but "left justified" doesn't actually exist
To be pedantic, you are actually being pedantic.
I can be just as irritatingly nitpicking if I put my mind to it.
But all it does is piss people off and start feuds.


Quote:
Originally Posted by Hitch View Post
On which devices are you saying that you can adjust line-spacing? Do you mean manually? Do you mean via coding?
Kindle PW3, "Aa" Page/Spacing
Of course, I could set it in CSS too.
However, "Alignment" is greyed out. "This book does not support Left Alignment and other enhanced typography options." So I assume that's only for KFX, and I'm making KF8.


Quote:
Originally Posted by Hitch View Post
As far as I know, trying to manually adjust line-height is pretty much only doable in K4PC/Mac and the newest K10 Fire. I certainly can't do that on any other device in our collection, which is fairly extensive, from PPWs to Voyages to Fires to iPads with K4iPad on them, and the aforementioned K10 (and of course, my much-loved ancient K2).
Are you distinguishing line spacing from line height? Spacing certainly can be adjusted. Height though, Kindle ignores anything I've tried to do (e.g. for standing caps, which always have extra spacing added below the line).
Quote:
Originally Posted by Hitch View Post
As jhowell said, it's supposed to be what it sounds like--the initial, or default, coding for an element, prior to any changes via coding. It's for pretty much anything, not just alignment, AFAIK.
I actually do know what the word "initial" means.
What I asked was not in general, but where does the "initial" value in an epub or mobi come from? Is it in a standard somewhere?

Quote:
Originally Posted by AlanHK
What does "initial" mean anyway?
Where is the "initial justification" defined? Is it different for each device, reader?

Quote:
Originally Posted by Hitch View Post
What's bizarre, though, @jhowell, is, isn't initial supposed to be overridable? Designed to be? Not act as the override itself? Or am I wrong about that?Hitch
Basically what I was asking.


Quote:
Originally Posted by jhowell View Post
In the CSS specification for text-align "initial" is defined as:
a nameless value that acts as 'left' if 'direction' is 'ltr', 'right' if 'direction' is 'rtl'

So for left-to-right text a CSS property declaration of "text-align: initial" is equivalent to "text-align: left". There is nothing in the specification about it being treated differently in terms of being overridable.

For books in KFX format (Enhanced Typesetting), Amazon allows the user to override the alignment of justified text to be left-aligned instead. That is independent of the CSS used AFAIK.
Seems I came across as a clueless idiot who needs to have words like "justify" or "initial" laboriously explained, but finally that answers the actual question I was posting about. Thanks.

Last edited by AlanHK; 10-02-2018 at 11:36 PM.
AlanHK is offline   Reply With Quote
Old 10-03-2018, 11:18 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by AlanHK View Post
Why not? Anyway, it works and I do it in all my books, including ones on Amazon for several years.
Because it's in their Publisher's Guidelines, and has been pretty much since the jump? Because once you set the body alignment, it's not overridable by the end user? And as seen in the latest Kindles, the end user is supposed to be able to choose if they want ragged right or justified text?

To wit, "The reason for this is that any styling on body text in the HTML will override the user’s preferred default reading settings. Users report such behavior as a poor reading experience." They used to expressly tell you not to do it, but now, they simply say "The body text in a reflowable Kindle book (fiction and non-fiction) must be all defaults. Amazon encourages content creators to use creative styles for headings, special paragraphs, footnotes, tables of contents, etc., but not for body text." [Ital emphasis added] This goes back to the very earliest Publishing Guidelines.


Quote:
To be pedantic, you are actually being pedantic.
I can be just as irritatingly nitpicking if I put my mind to it.
But all it does is piss people off and start feuds.
My point is, we're not the only people who will see this thread. If we were, I wouldn't have said anything. But, we're not. I don't see a crapload of benefit to perpetuating the incorrect use of a term that Microsoft started, which lends itself to less clarity. I tried to find less pedantic ways to say it, but..."left-justified" doesn't exist. And as it's less clear than left-aligned, right-aligned, justified, why use it? If you want to, great. But I don't see anything wrong with sharing the information that it's incorrect terminology. Hopefully, someone will read this and then NOT use it.

Quote:
Kindle PW3, "Aa" Page/Spacing
Of course, I could set it in CSS too.
However, "Alignment" is greyed out. "This book does not support Left Alignment and other enhanced typography options." So I assume that's only for KFX, and I'm making KF8.
Actually, for the newer Kindles, you can change the alignment (my K10), justified or left-aligned/ragged-right. Amazon's been heading in this direction for the last few years. And, to bring this back around, this is one of the reasons that they don't want bookmakers setting the alignment on the body text, because (just like body fonts) it then won't be overridable by the end user, to their preferences.

And that's KF8, not KFX. I can change both the alignment, and the line-spacing (line-heights, effectively) on my K10, on any mobi we've made, and most of the books I buy from Amazon--unless the producer of that book has set the body text defaults in a way that precludes that. Which means, line-height settings other than the default, or alignment settings.

If you make a book with justification set, for example, you cannot change the alignment, on my K10. We've tested that. I would fully expect a raft of KQNS, headed all our ways, as book producers who used to set body alignments to justified, from older books, as this functionality becomes more widespread in the Kindleverse. I mean, hell, we used to set it, too, in the earliest days of my own biz, and yes--I fully expect to see those suckers coming back to us, for fixing.

I expect this because I know factually that Amazon has sent KQN's (Kindle Quality Notices) to publishers who've set the body alignment--both for align-left, and justified. We had a client that insisted on left-alignment, for her book, even though I told her that Amazon would give her fits, eventually, and sure as crap, not only did she get a KQN, but they removed the book from sale until it was fixed.

Quote:
Are you distinguishing line spacing from line height? Spacing certainly can be adjusted. Height though, Kindle ignores anything I've tried to do (e.g. for standing caps, which always have extra spacing added below the line).
No, I'm talking about line-spacing, not line-height. (Although, arguably, they're rather hard to extricate from one another, in this environment. How do you set line-spacing, if not through line-height?) If you can manually (as the end-user, I'm talking about, not as the person making the books) adjust the line-spacing, on your PPW3, that's a function I hadn't seen on my devices, until the Fire10. It doesn't surprise me--I don't have every Kindle ever made, of course. I simply hadn't seen that, prior to the K10.
Amazon's made it clear that they've been moving in this direction with their further instructions not to mess with the line-heights (in this case, I am talking about line-height, which of course, does affect spacing, one way or the other) for the last few years.

Just like fonts and alignment, presumably, if you override body line-heights/line-spacing, the same thing would happen--the end user wouldn't be able to set it to their own preference.

We've all played with and coded line-heights for various elements--say, pullquotes, text-boxes, etc. Where you can get in trouble is with the body text--in which case, Amazon overrides it anyway at the KDP intake. (I recently had this discussion with a client, who was irate that his "last bookmaker" had done what he'd asked, and made his line-heights effectively 2x line spacing. I had to prove to him that what his previous bookmaker had handed to him was NOT what he had, once he'd uploaded it, when Amazon switched it back to the ubiquitous 1.2em line-heights.)

Quote:
I actually do know what the word "initial" means.
What I asked was not in general, but where does the "initial" value in an epub or mobi come from? Is it in a standard somewhere?

Basically what I was asking.
I know that. I'm asking the same thing. AFAIK, it's not part of the ePUB standard, even in ePUB 3 or 3.01. The word "initial" isn't in the KP Guidelines. Presumably, it's something that's being added via KG, and for what purpose, who the hades knows? We'll all end up parsing it and dissecting it, as it shows up more frequently. Actually, what I'm asking about is, why isn't it being overridden?


Quote:
Seems I came across as a clueless idiot who needs to have words like "justify" or "initial" laboriously explained, but finally that answers the actual question I was posting about. Thanks.
No, that's not what I was saying at all. Look, I'm sorry you're annoyed about the typography thing. I don't know how I could have phrased it that wouldn't have vexed you, but again--don't see the point in perpetuating that usage. Vis-a-vis initial, yes, of course, I'm interested to see what shakes out on it, as eventually, it will impact all of us. Especially if some coding, implanted during conversion, is going to mess with our CSS by NOT being overridable. That's going to affect us all.

Hitch
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is text-align-last not supported? fxp33 Editor 2 01-28-2018 02:27 PM
Text still full justifying on iPad, even through style says align left SamL ePub 13 04-20-2017 10:24 PM
text-align:lol; odedta ePub 6 06-16-2014 09:40 AM
Center align text in epub virtual_ink ePub 23 08-31-2011 06:27 AM
I can not align the text...help please! XD derfel_spain ePub 17 12-18-2010 09:45 AM


All times are GMT -4. The time now is 01:49 AM.


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