07-18-2013, 04:26 PM | #16 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
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. |
|
07-18-2013, 11:43 PM | #17 | |
Bibliophagist
Posts: 35,401
Karma: 145435140
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Quote:
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. |
|
Advert | |
|
08-05-2013, 04:42 AM | #18 |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
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 |
08-05-2013, 04:53 AM | #19 |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, 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. |
08-05-2013, 05:22 AM | #20 |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
@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; } |
Advert | |
|
08-05-2013, 05:40 AM | #21 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
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:
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. |
|
08-05-2013, 05:59 AM | #22 |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
@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. |
08-05-2013, 06:43 AM | #23 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
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. |
|
08-07-2013, 06:03 AM | #24 | |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
Quote:
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. |
|
08-07-2013, 04:46 PM | #25 | ||||
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
Quote:
Quote:
Quote:
Last edited by Rev. Bob; 08-07-2013 at 04:55 PM. |
||||
08-07-2013, 05:43 PM | #26 |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
@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 |
08-07-2013, 06:15 PM | #27 | ||
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
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:
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... |
||
08-07-2013, 06:33 PM | #28 |
Addict
Posts: 264
Karma: 9246
Join Date: Feb 2010
Location: Berlin, Germany
Device: Kobo H20, iPhone 6+, Macbook Pro
|
@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? |
08-07-2013, 06:46 PM | #29 | |
Wizard
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
Quote:
Helen |
|
08-07-2013, 07:10 PM | #30 |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
|
|
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 |