Purpose

To test different methods of spacing (without using nbsp) and font-sizing on a range of reading systems and machines using the same information as either .mobi or .epub as appropriate for the following

Kindle

Kindle Keyboard

Kindle app for iPad

iBooks for iPad

Sony Reader PRS-350

Kindle, Kindle keyboard and the Kindle app for iPad give generally the same results, except that on iPad the font size changes are smaller and on Kindle machines “text-indent” and “margin-left” have different values.

I have also tested the .epub version with the Kobo and Tradebit apps on iPad4. These both give the same results that iBooks does.

Version 3.0 December 2012

Created with Sigil 0.6.2

Converted with Calibre 0.9.9

em spacing

The poem below is spaced using using whole em’s with each line in a separate div. CSS property “text-indent” in the first half, then with “margin-left” in the second half. Below that are further examples.

This works as .epub for iBooks and as .epub on Sony Reader.

It only works as .mobi for Kindle or Kindle for iPad where the em’s are a whole number. Fractions of em’s are treated like the nearest whole number and if another class is added, further confusion results.

On a Kindle “margin-left” gives much bigger indents than “text-indent”. On Kindle for iPad they both give the same indent.

~~~

When our gallant Norman foes

Made our merry land their own.

And the Saxons from the Conqueror were flying,

At his bidding it arose,

In its panoply of stone,

A sentinel unliving and undying.

Insensible, I trow,

As a sentinel should be,

Though a queen to save her head should come a-suing;

There’s a legend on its brow

That is eloquent to me,

And it tells of duty done and duty doing.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

I keep my solemn watch and ward!”

Within its wall of rock

The flower of the brave

Have perished with a constancy unshaken.

From the dungeon to the block,

From the scaffold to the grave,

Is a journey many gallant hearts have taken.

And the wicked flames may hiss

Round the heroes who have fought

For conscience and for home in all its beauty,

But the grim old fortalice

Takes little heed of aught

That comes not in the measure of its duty.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

That keeps its solemn watch and ward!”

SIR WILLIAM GILBERT

text-indent

This line div class none(0em)

This line div class half (0.5em)

This line div class one (1em)

This line div class onehalf (1.5em)

This line div class two (2em)

This line div class twohalf (2.5em)

This line div class three (3em)

This line div class threehalf (3.5em)

~~~

This line div class none (0em)

This line div class one (1em)

This line div class two (2em)

This line div class three (3em)

This line div class four (4em)

This line div class five (5em)

This line div class six (6em)

This line div class seven (7em)

margin-left

This line div class none (0em)

This line div class halfm (0.5em)

This line div class onem (1em)

This line div class onehalfm (1.5em)

This line div class twom (2em)

This line div class twohalfm (2.5em)

This line div class threem (3em)

This line div class threehalfm (3.5em)

~~~

This line div class none(0em)

This line div class onem (1em)

This line div class twom (2em)

This line div class threem (3em)

This line div class fourm (4em)

This line div class fivem (5em)

This line div class sixm (6em)

This line div class sevenm (7em)

text-indent with 0.7em text

This line div class small (0em)

This line div class small half (0.5em)

This line div class small one (1em)

This line div class small onehalf (1.5em)

This line div class small two (2em)

This line div class small twohalf (2.5em)

This line div class small three (3em)

This line div class small threehalf (3.5em)

~~~

This line div class small (0em)

This line div class small one (1em)

This line div class small two (2em)

This line div class small three (3em)

This line div class small four (4em)

This line div class small five (5em)

This line div class small six (6em)

This line div class small seven (7em)

margin-left with 0.7em text

This line div class small (0em)

This line div class small halfm (0.5em)

This line div class small onem (1em)

This line div class small onehalfm (1.5em)

This line div class small twom (2em)

This line div class small twohalfm (2.5em)

This line div class small threem (3em)

This line div class small threehalfm (3.5em)

~~~

This line div class small (0em)

This line div class small onem (1em)

This line div class small twom (2em)

This line div class small threem (3em)

This line div class small fourm (4em)

This line div class small fivem (5em)

This line div class small sixm (6em)

This line div class small sevenm (7em)

~~~

This line div class small half (0.5em)

This line div class small onehalf (1.5em)

This line div class small twohalf (2.5em)

~~~

This line div class small halfm (0.5em)

This line div class small onehalfm (1.5em)

This line div class small twohalfm (2.5em)

Font size etc.

To test the difference between using CSS “0.7em” and HTML tag “small” to modify text size or “1.4em” and “big”. The first letter of each word should be larger than the rest of that word.

Tag “big” is listed as supported in the Kindle mobi specification. It was deprecated in HTML5 but appears to work.

Kindle can handle fractions of an em for font-size but the differentiation between sizes is smaller than in an epub. This differentiation is smaller still in Kindle for iPad.

Also to test “margin-right” and “padding-right” for right aligned text.

“margin-right” and “padding-right” do not work in Kindle or Kindle for iBooks.

“margin-left” gives a bigger indent than “padding-left” in Kindle but not in Kindle for iBooks.

~~~

This is 0.7em

SIR WILLIAM GILBERT

This is tag small

SIR WILLIAM GILBERT

This is 1.4em

SIR WILLIAM GILBERT

This is tag big

SIR WILLIAM GILBERT

~~~

The same 4 with padding-right

SIR WILLIAM GILBERT

SIR WILLIAM GILBERT

SIR WILLIAM GILBERT

SIR WILLIAM GILBERT

~~~

This is normal text in a paragraph

This is tag small text in a paragraph

This is tag big text in a paragraph

This is normal text in a div

This is tag small text in a div

This is tag big text in a div

~~~

This is normal text in a styled paragraph

This is tag small text in a styled paragraph

This is tag big text in a styled paragraph

This is normal text in a styled div

This is tag small text in a styled div

This is tag big text in a styled div

~~~

text-indent 3em

Signature text

text-indent 5em

Signature text

text-indent 7em

Signature text

~~~

margin-left 3em

Signature text

margin-left 5em

Signature text

margin-left 7em

Signature text

Percentages

This is spaced using CSS properties “text-indent” or “margin-left” with percentages ( 2, 4 and 6).

The spacing can in theory be adjusted to exactly what you want.

Works with epub for iBooks and epub for Sony Reader

On the Kindle “margin-left” gives a non-adjustable, fixed indent and “text-indent” gives a non-adjustable, larger fixed indent. With Kindle for iPad both fixed indents are the same.

~~~

When our gallant Norman foes

Made our merry land their own.

And the Saxons from the Conqueror were flying,

At his bidding it arose,

In its panoply of stone,

A sentinel unliving and undying.

Insensible, I trow,

As a sentinel should be,

Though a queen to save her head should come a-suing;

There’s a legend on its brow

That is eloquent to me,

And it tells of duty done and duty doing.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

I keep my solemn watch and ward!”

Within its wall of rock

The flower of the brave

Have perished with a constancy unshaken.

From the dungeon to the block,

From the scaffold to the grave,

Is a journey many gallant hearts have taken.

And the wicked flames may hiss

Round the heroes who have fought

For conscience and for home in all its beauty,

But the grim old fortalice

Takes little heed of aught

That comes not in the measure of its duty.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

That keeps its solemn watch and ward!”

SIR WILLIAM GILBERT

ensp

This is spaced using enspace entities. You cannot see them in the code if Sigil has converted them to the correct sized space. The code is [&en sp;] with no space between the letters.

There is one enspace between these brackets ( ) 2 here (  ) and 3 here (   ). Results for the emspace (larger) and thinspace (smaller) entities are exactly the same.

This works as .mobi on Kindle, .mobi on Kindle for iPad and as .epub for iBooks.

It does not work as .epub on Sony Reader where spaces (except the non-breaking space) display as “?” The Sony has a limited set of characters that it recognises. This may be true of some other makes, the epub specification does not list every character that must be included.

If you convert this file with Calibre do not tick the box in Preferences to “Transliterate unicode characters to ASCII” otherwise all entities disappear on all of my test machines.

~~~

When our gallant Norman foes

Made our merry land their own.

And the Saxons from the Conqueror were flying,

At his bidding it arose,

In its panoply of stone,

A sentinel unliving and undying.

Insensible, I trow,

As a sentinel should be,

Though a queen to save her head should come a-suing;

There’s a legend on its brow

That is eloquent to me,

And it tells of duty done and duty doing.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

I keep my solemn watch and ward!”

Within its wall of rock

The flower of the brave

Have perished with a constancy unshaken.

From the dungeon to the block,

From the scaffold to the grave,

Is a journey many gallant hearts have taken.

And the wicked flames may hiss

Round the heroes who have fought

For conscience and for home in all its beauty,

But the grim old fortalice

Takes little heed of aught

That comes not in the measure of its duty.

“The screw may twist and the rack may turn.

And men may bleed and men may burn.

On London town and all its hoard

That keeps its solemn watch and ward!”

SIR WILLIAM GILBERT

Table of Contents

Purpose

em spacing

Font size etc.

Percentages

ensp