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 05-03-2016, 07:55 PM   #1
heulwen.jones
Member
heulwen.jones began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2014
Device: Kindle Fire, iPad
Kindle for iOS (AZK format) - line height issue

Hi there,

I am having an issue when I convert my Kindle to AZK format (for iOS) where within some paragraph there is a variation in line height from one line to the next.

This happens when a paragraph contains a quote which extends at least the full length of a line. To provide more detail:
1) Quotes appear in a span tag like <span class="Quote"> within the paragraph (paragraph enclosed in a <p> tag)
2) The font size of a quote (set in the CSS) is smaller than the font size of the paragraph, and the font is bold.
3) line-height is set on the paragraph class (<p> tag) but not on the quote class (<span> tag)
4) In this example the paragraph <p> font-size is 0.95em and line-height is 1.287em; quote <span> font-size is 0.803em

The Kindle Fire etc. is obeying the line-height of the paragraph regardless of span tags within the paragraph. However it appears to me that Kindle for iOS is not obeying the line-height of the <p> tag if the text in the <span> tag extends the full length of a line. Possibly it still does use the line-height set in the <p> tag (eg. 1.287em) but because all the text on the line is 0.0803em (instead of 0.95em) it recalculates the line-height based on this lower font-size value??

In other words it is like the Kindle Fire calculates line-height a paragraph at a time while Kindle for iOS calculates line-height a line at a time??

Does anyone have any ideas how to solve or workaround this issue?

Many thanks in advance for your help. Heulwen
heulwen.jones is offline   Reply With Quote
Old 05-04-2016, 09:01 AM   #2
Notjohn
mostly an observer
Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.Notjohn ought to be getting tired of karma fortunes by now.
 
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
The default line height on the Kindle platform is 1.2, I believe. (Whatever it may be, there IS a default line height.) Therefore I think it's unwise to specify a line height at all in your style sheet.

Keep it simple and let the defaults rule!
Notjohn is offline   Reply With Quote
Advert
Old 05-05-2016, 07:28 PM   #3
heulwen.jones
Member
heulwen.jones began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2014
Device: Kindle Fire, iPad
Unfortunately in this case I do need to specify line height : (

It seems to work fine on most Kindle devices, just an issue on Kindle for iOS?
heulwen.jones is offline   Reply With Quote
Old 05-09-2016, 04:06 AM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Kindle actually (spottily) enforces a hard minimum of 1.2 for the line height, and ignores any line height that is smaller.

Worse, IIRC, some Kindle devices implement that limit incorrectly on some devices, resulting in the line height being calculated incorrectly if the font's ascender and descender don't add up to the em square, causing it to increase the line height to even more than 1.2x the font size because of the incorrect font height calculation.

If your line height is at least 1.2, I would suggest taking your fonts and running them through Fontographer or any other program that can automatically recompute the font metrics. (I think Adobe's font SDK might even be able to do this on its own.) See if that fixes the problem.

If you are trying to specify a line height less than 1.2, you'll have to find a different way to achieve the desired effect.
dgatwood is offline   Reply With Quote
Old 05-09-2016, 05:03 AM   #5
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: 73,896
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
And then there are some fonts who's metrics can give you a smaller line height with a Kindle. So the suggestion to ignore line-height is a very good one.
JSWolf is offline   Reply With Quote
Advert
Old 05-09-2016, 04:55 PM   #6
heulwen.jones
Member
heulwen.jones began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2014
Device: Kindle Fire, iPad
Thanks guys for your help.

I suspect (I haven't tested yet) that even if I don't specify line height I am still going to have the same problem on the Kindle for ios - ie. lines within some paragraphs will have a smaller line height than other lines in the same paragraph when a span tag extends at least the full length of a line (containing a quote with a smaller font size), so the line height for that line is being calculated as less. This means I will still have varying line height across lines in a single parapgraph which is not so pretty : )
heulwen.jones is offline   Reply With Quote
Old 05-12-2016, 12:23 AM   #7
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
And then there are some fonts who's metrics can give you a smaller line height with a Kindle. So the suggestion to ignore line-height is a very good one.
Hence my recommendation to open it in Fontographer and have it recompute the metrics.
dgatwood is offline   Reply With Quote
Old 05-12-2016, 12:24 AM   #8
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by heulwen.jones View Post
Thanks guys for your help.

I suspect (I haven't tested yet) that even if I don't specify line height I am still going to have the same problem on the Kindle for ios - ie. lines within some paragraphs will have a smaller line height than other lines in the same paragraph when a span tag extends at least the full length of a line (containing a quote with a smaller font size), so the line height for that line is being calculated as less. This means I will still have varying line height across lines in a single parapgraph which is not so pretty : )
You definitely should be using line height to fix that. However, it sounds like you're inadvertently setting it to less than 1.2x the (probably incorrectly) computed line height for one of the fonts. Try a larger value and see if the problem goes away.
dgatwood is offline   Reply With Quote
Reply

Tags
azk, ios, line height


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Kindle for iOS (AZK format) - image sizing issues heulwen.jones Kindle Formats 3 05-11-2016 07:58 PM
Kindle for iOS (AZK format) - Layout issues heulwen.jones Kindle Formats 3 05-03-2016 07:18 PM
Issues sideloading AZK to Kindle for iOS evergreen Kindle Formats 4 01-01-2016 03:10 PM
Line-height in Kindle books RbnJrg Kindle Formats 8 07-26-2013 03:56 PM
Kindlegen 2.8, plain Kindle & line-height davidnwelton Kindle Formats 4 03-25-2013 01:05 AM


All times are GMT -4. The time now is 10:55 AM.


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