Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 07-18-2013, 04:26 PM   #16
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by tshering View Post
There is supposed to be a difference (cf. for instance here). In the case of { line-height: 1.3em; } child elements inherit the computed value, whereas in case of { line-height: 1.3; } they inherit the ratio that is used for the calculation. I took this for true without testing and thought it may explain what GeoffR reported.
According to that page, the difference is that length-unit line-heights are inherited poorly. That makes some degree of sense, but it's bad inheritance; the page is murky on whether the fault is in how CSS is implemented or in how the specification is supposed to work (engine vs. spec).

The takeaway here, regardless, is:

1. If you're an ebook author, don't put units on your line-height!

2. If you handle ebook code, see #1.

3. If you maintain software that generates ebook code, see #1.

4. If the device-specified line-height is getting translated into a value with units - whatever those units are - instead of a unitless value, that is bad behavior and should be regarded as a bug that needs fixed ASAP.
Rev. Bob is online now   Reply With Quote
Old 07-18-2013, 11:43 PM   #17
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 1,836
Karma: 5698904
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Aura HD, Glo, Nexus 7, iPad 3
Quote:
Originally Posted by Rev. Bob View Post
While I agree with the rest of your message, I have to point out that "em" does not belong on that list, being a relative rather than absolute unit. It's still a good rule of thumb to say "no units on line-height," but ems should be okay due to their relative nature.
I've had occasional issues when using em as the unit has caused issues with inheritance where the inherited line height seems to be applied as if the font size did not change. Personally, I think this is the result of poor programming but its led me to avoid the use of any units in line-height statements.

edit: Just read tshering's comment and it fits with what I've seen.

Regards,
David

Last edited by DNSB; 07-18-2013 at 11:46 PM.
DNSB is offline   Reply With Quote
Old 08-05-2013, 04:42 AM   #18
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
Do you know which absolute font size unit an entry in "Kobo ereader.conf" for "readingFontSize" has?

I still try to figure out the exact interaction of
1 !important rules in kepub-book.css
2 entries in "Kobo ereader.conf"
3 CSS rules inside the kepub
ibu is offline   Reply With Quote
Old 08-05-2013, 04:53 AM   #19
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
In theory, !important should trump any other CSS rule of equal or lower specificity, but be overridden by CSS of higher specificity. Thus, an !important style on "body p img" will overrule any conflicting style on "p img" or "body a img" but will submit to "body p a img" or "body p img.special" (both more specific). Given that the image in question is assigned the ID of "x", rules applied to "#x" should trump everything else, as an ID-level rule is as specific as it's possible to get.

That's from memory, as I try to structure my CSS so that it cascades properly without relying on !important, but I'm reasonably confident that it's right.
Rev. Bob is online now   Reply With Quote
Old 08-05-2013, 05:22 AM   #20
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
@Rev. Bob
You are talking about CSS specifications of the W3C.

But I like to understand the interactions of the Kobo software (the reading options of the GUI) and kepub-book.css

One simple test shows to me, that the kepub.css with "!important" does not win over the reading option "font-size".

I change the kepub-book.css with
p { font-size: 15px !important; }
(15px should result in 1,77mm on a display with 1024px on a length of 121mm)

But the result is a font in 4,5mm.
That means: the kepub-book.css rule does not win.

Of course I checked if the kepub-book.css is interpretated. Therefore I use a rule like
p { margin-top: 1em !important; }
ibu is offline   Reply With Quote
Old 08-05-2013, 05:40 AM   #21
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by ibu View Post
@Rev. Bob
You are talking about CSS specifications of the W3C.
Quite so; the whole point of CSS is that it's a language that behaves in predictable ways. Therefore, the CSS spec is the logical foundation.

Quote:
Originally Posted by ibu
But I like to understand the interactions of the Kobo software (the reading options of the GUI) and kepub-book.css

One simple test shows to me, that the kepub.css with "!important" does not win over the reading option "font-size".
Nor should it.

Imagine you've defined a user stylesheet for your browser, you're visiting a site that has its own stylesheet, and you've used the hotkeys to make the font size larger. The browser's duty is to apply the site sheet, then your user sheet, then the hotkey changes...in that order. In this case, the individual EPUB's CSS is the site sheet, kepub.css is your user sheet, and the GUI controls are the hotkeys; the GUI is supposed to win. Otherwise, the device is misbehaving and a bug report is in order.

In other words, the further an option is from the user's control, the lower its priority becomes. The whole theory is to let users make their own choices as much as possible, preventing sites from overriding them.

Last edited by Rev. Bob; 08-05-2013 at 05:44 AM.
Rev. Bob is online now   Reply With Quote
Old 08-05-2013, 05:59 AM   #22
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
@Rev. Bob
In a browser I have the option to press STRG+0 to reset the font-size to the winning style rules.
Such an option does not exist in the Kobo.

Ok, we have to accept that, we cannot hack it.
But it's necessary to mention it, when we're looking for analogies.

And:
I have no idea why I get a font with a height of 4,5mm.

I can't explain that result.

A logical result would be 3,1 mm. That is the mathematically correct value for 28px, which is set in the Kobo ereader.conf.

But there is a strange interaction of the reading options of the Kobo and CSS, which I do not understand yet.
ibu is offline   Reply With Quote
Old 08-05-2013, 06:43 AM   #23
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by ibu View Post
@Rev. Bob
In a browser I have the option to press STRG+0 to reset the font-size to the winning style rules.
Such an option does not exist in the Kobo.
One of the spots on the Kobo's font-size slider in the GUI has to be the default position. You may not be able to snap to it automatically, but that in no way means that you can't get back there.

At any rate, you seem to be leaving some factors out of your calculations: the semantic size of the text, soft vs. hard pixels, and a device-specified hard minimum size.

Semantic size: Okay, so the paragraph text is supposed to be 15px tall. Is that "small" or "medium" - or another point on that spectrum? How is that determined? Does the document have "smaller" relative text that must remain legible?

Soft vs. hard: As far as the web is concerned, all iPads have the same screen resolution, 1024x768. That's because that's what they report; it's their "soft" resolution. However, some iPads (3 and 4) actually have four times that many dots on their screens, 2048x1536.

Hard minimum: Once you get below a certain size, text becomes illegible. That's usually not the desired outcome, so some platforms impose a minimum size for text. (I am given to understand that on some Apple devices, it's impossible to go below six points.) If you were to specify a 10pt standard font size and then include some fine print that's supposed to be 50% of standard, that hard minimum could cause the fine print to lock at 6pt and possibly recalibrate the document norm up to 12pt to preserve the desired proportions. The minimum size could even depend on the particular font(s) being used.

Some or all of those factors could be coming into play here.

Last edited by Rev. Bob; 08-05-2013 at 06:48 AM.
Rev. Bob is online now   Reply With Quote
Old 08-07-2013, 06:03 AM   #24
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
Quote:
Originally Posted by Rev. Bob View Post

Semantic size: Okay, so the paragraph text is supposed to be 15px tall. Is that "small" or "medium" - or another point on that spectrum? How is that determined? Does the document have "smaller" relative text that must remain legible?
I've never heard the term "semantic size".
I'm not quite sure, what you want to express with using that term.
I know that each user has on each device one single ergonomic size for a specific font. For "running text" (not sure what's the correct typografic jargon in english).

Only the user knows that.
Not any producer of readers can know that.
Not any producer of eBooks can know that.

That's the simple reason, why every font-size rules in digital media for running text other than "1em" is evil.
ibu is offline   Reply With Quote
Old 08-07-2013, 04:46 PM   #25
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by ibu View Post
I've never heard the term "semantic size".
I'm not quite sure, what you want to express with using that term.
I mean to express a core part of the CSS spec that deals with font size. If you're going to tinker with CSS, you should know about this. They call it "absolute size," but it's a semantic designation:

Quote:
Originally Posted by CSS2 specification
<absolute-size>
An <absolute-size> keyword is an index to a table of font sizes computed and kept by the UA. Possible values are:

[ xx-small | x-small | small | medium | large | x-large | xx-large ]

The following table provides user agent guidelines for the absolute-size mapping to HTML heading and absolute font-sizes. The 'medium' value is the user's preferred font size and is used as the reference middle value.
See also "smaller" and "larger", which mean "go up/down one size."

Quote:
Originally Posted by ibu
I know that each user has on each device one single ergonomic size for a specific font. For "running text" (not sure what's the correct typografic jargon in english).
False, as noted above. Every UA - that's User Agent, whether we're talking about a browser, dedicated e-reader, or app - is expected to maintain seven distinct sizes, although six of them are usually calculated from one "normal size" baseline. The ratio between them can vary between UAs, and using the UA's interface to say "make it smaller" or "make it larger" affects all seven sizes.

Quote:
Originally Posted by ibu
That's the simple reason, why every font-size rules in digital media for running text other than "1em" is evil.
You are aware that defining text as being "1em" in size is pointless, right?

Last edited by Rev. Bob; 08-07-2013 at 04:55 PM.
Rev. Bob is online now   Reply With Quote
Old 08-07-2013, 05:43 PM   #26
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
@Rev. Bob

Thanks for your hints about "<absolute-size>".

Do I understand you correctly, that you suggest that web authors should declare the value "medium" for running text instead of 1em?

I've never seen a stylesheet which uses that value. (That's not an argumente of course, just a polite statement.)

Do you know a high quality coded website which uses the value "medium" or one of the six others? Please take it as a curious question. There's no other intention in the question
ibu is offline   Reply With Quote
Old 08-07-2013, 06:15 PM   #27
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by ibu View Post
Do I understand you correctly, that you suggest that web authors should declare the value "medium" for running text instead of 1em?
You do not. Web authors should not declare any value for standard text. It will default to "medium" (except on IE, which uses "large" because it's weird) all by itself.

The reason that defining text as 1em normally makes no sense is that ems are a relative unit, defined in proportion to the current text size. Thus, saying "make this text exactly the same size as normal" is usually silly. (The exception is when the text normally wouldn't be the same size for some reason - say, if you're redefining header sizes.)

Quote:
Originally Posted by ibu
Do you know a high quality coded website which uses the value "medium" or one of the six others? Please take it as a curious question. There's no other intention in the question
I could refer you to this one, but I maintain it, so it might not fit your criteria...

Seriously, the "general" spreadsheet there makes significant use of "larger" and "smaller", precisely because I'm a strong advocate of letting users control their environment as much as possible. There's a delicate balance between that and the demands of making a page look like the boss wants it to, of course...
Rev. Bob is online now   Reply With Quote
Old 08-07-2013, 06:33 PM   #28
ibu
Addict
ibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipseibu can illuminate an eclipse
 
Posts: 201
Karma: 8170
Join Date: Feb 2010
Location: Berlin, Germany
Device: iPhone 4S, Kobo Glo
@Rev. Bob
Now I got what you wanted to explain.
I agree. You can omit p { font-size: 1em }.
May be I was so used to it, because in the past you had to fight against strange browser behaviours which made it necessary.
I don't remember.
Thanks to correct me.

And thanks for the link to your page. I looked into the CSS. Indeed there are values like "larger"

I appreciate it, that you are strong advocate of letting users control their environment

Apropos:
Does anyone know a method to disable hyphenation on a Kobo Glo without any embedded CSS?
ibu is offline   Reply With Quote
Old 08-07-2013, 06:46 PM   #29
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,580
Karma: 24987036
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
Quote:
Originally Posted by ibu View Post
@Rev. Bob

Thanks for your hints about "<absolute-size>".

Do I understand you correctly, that you suggest that web authors should declare the value "medium" for running text instead of 1em?

I've never seen a stylesheet which uses that value. (That's not an argumente of course, just a polite statement.)

Do you know a high quality coded website which uses the value "medium" or one of the six others? Please take it as a curious question. There's no other intention in the question
Maybe not talking about the same thing as mobi format is not a website, but many mobi books use small, medium, large in the stylesheet.

Helen
speakingtohe is offline   Reply With Quote
Old 08-07-2013, 07:10 PM   #30
Rev. Bob
Guru
Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.Rev. Bob ought to be getting tired of karma fortunes by now.
 
Rev. Bob's Avatar
 
Posts: 733
Karma: 4005200
Join Date: Feb 2013
Device: Kobo Glo, Kindle Touch
Quote:
Originally Posted by speakingtohe View Post
Maybe not talking about the same thing as mobi format is not a website, but many mobi books use small, medium, large in the stylesheet.
HTML, XML, and CSS are primarily known as web technologies, but that's also what EPUBs are made of.
Rev. Bob is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Overriding Proportional Spacing townsend Sigil 6 05-02-2013 10:22 PM
Kobo Mini font/line spacing problem speakingtohe Devices 6 11-26-2012 01:46 AM
epub to mobi - keep non proportional font ? cybmole Conversion 6 02-06-2011 09:14 AM
Problem with epub to lrf with changing font size and line spacing kleinbiker Calibre 4 12-17-2009 08:55 AM
How to change the line spacing of a font IceHand Bookeen 29 03-07-2009 03:09 AM


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


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