View Single Post
Old 08-26-2010, 04:50 PM   #3
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,595
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
The first thing I wanted to test was first line text indents of paragraphs.

In CSS this is controlled by the text-indent: attribute. Values can be specified as a length (pixels, points, cm, inches, ems) or a percentage (of the available width).

KindleGen preserves percentages and ems, rounded to the nearest whole number, and converts all other measurements to pixels, counting 96 pixels per inch.

Since only ems scale with the font size, it seems that it will almost always be best to specify the text indent in ems. Unfortunately, we can only have a whole number of ems, so we don't have a lot of choice in indent size. Also, since the Kindle 1 displays ems as bigger than on the Kindle 2 (I'm reliably informed), it seems that a text indent of 1em may always the best choice.

I also looked at hanging indents. Using a left margin of 1em and a text-indent of -1em doesn't work with Kindlegen. It generates a blockquote inside a paragraph with a negative textindent (width), and that just gets rendered as a blockquote.
But if we instead specify a left padding of 1em, Kindlegen ignores this, and we get the result we want both on the kindle and in the ePub.

FONT="Monospace"]text-indent:[/FONT]
Use a whole number of ems. For hanging indents, specify the same magnitude of ems for padding-left as for the negative text-indent:

Well, this works really well on the Kindle, and on the Kindle Previewer. Hanging Indents don't seem to work at all on Kindle for Mac. Sigh...

Next: margin-left: and how to indent whole paragraphs and still allow text-indent to work correctly. (Always assuming I can work it out!)
Attached Files
File Type: zip Text Indents Sampler.zip (6.0 KB, 341 views)
pdurrant is offline   Reply With Quote