View Single Post
Old 08-05-2013, 05:25 AM   #46
Anak
Guru
Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.Anak ought to be getting tired of karma fortunes by now.
 
Posts: 603
Karma: 641742
Join Date: Mar 2012
Location: DE
Device: Kobo Glo
Quote:
Originally Posted by DNSB View Post
Using the 150% font-size declaration makes the kepub font size match the epub font size. That way, I don't have to muck with the font size slider when I change renderers.

Regards,
David
If you want the default font size to match accurately on both renderers you should replace the % value with a pt value in de body tag. The font remains perfectly scalable.
Adobes default font size (1em) is 12pt. Kobos Access default font size is/was 14pt. That is why the text on my Touch is always bigger when using the Access renderer. But can be different now. Or different on a Aura HD.

Code:
body {
font-size:12pt;
/* default font size 12pt = 100% = 1em */
}
IMO it is very unlikely that a rounded % value will match perfectly. Under the assumption that 12pt and 14pt is still accurate, you'll get:
Adobe
12 pt (default). 14pt (116.667%)
Access
14 pt (default). 12pt (85.714%)


Try this css. It should give the same results but the redundancies are removed. Only the different settings from the body defaults are specified.
Code:
@page {
  margin: 5pt !important;
}

body {
/* default settings */
   margin: 0 !important;
   padding: 0 !important;
   padding-bottom: 0.2em !important;
   font-size: 150% !important;
   text-indent: 0 !important;
   text-align: left !important;
   line-height: 1.0 !important;
   widows:  0 !important;
   orphans:  0 !important;
   -webkit-hyphens: auto !important;
   }
div {
   text-indent: 4% !important;
   }
p {
   text-indent: 4% !important;
   margin:0;
   padding:0;
   }
May need a little tweaking to get it right.


A brief example when the output will be different:
Code:
p {
margin: 0 !important;
}
compared to
Code:
p {
margin: 0 0 0 0 !important;
}
The latter overrules all margin settings.

If a class is defined as
Code:
.example {
margin-top: 5em;
}
It work as aspected with a 5em top margin in situation 1. In the second situation the 5em top margin will be ignored and set to 0.

When defining default values it is best to define as margin:0 !important instead of margin: 0 0 0 0 !important or margin-left, -right, -top, -bottom. The same applies for other selectors.

Last edited by Anak; 08-05-2013 at 06:59 AM.
Anak is offline   Reply With Quote