View Single Post
Old 01-06-2020, 03:27 PM   #3
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: 79,857
Karma: 146918083
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by hobnail View Post
When I buy a book I always "fix" the css so that the font size for the running/body text is 1em. After deleting any css for the body tag, at the end of the css files I add one for body that has font-size:100%;line-height:1.2;width:auto; and set the margins, padding, and border to 0. Then I delete any font-size settings in the body text p tags; if it's not 1em then I find other occurrences (with the same size) and delete them. That pretty much does the job although the headings and whatnot may be the wrong size but I can live with that.

In calibre's conversion settings for Look & Feel I have Disable font size rescaling unchecked and Base font size at 0.0pt. For Output profile I've selected Tablet.

A recent book I bought had the font-size set to some value larger than 1em for the body tag, then in the p tags used something less than 1em, probably bringing it back to something close to 1em. With my above settings the resulting AZW3 -> EPUB conversion produced css with font-size numbers that were above and below 1.0, but less than 2.0. I followed my usual recipe outlined in the first paragraph but it still wasn't right in the Kobo Forma. So then I checked the Disable font size rescaling in the conversion settings and converted it and followed my recipe and it came out correctly.

What's the best way to normalize the font size to 1em? Maybe I should be setting the Base font size to 12 or something? I have no idea what 1em would be in points for the Forma.
What I do im most cases with a KF8 eBook is a use the KindleUnpack plugin for Calibre to shift the KF8 to ePub. I then load the ePub into the editor. I use the epubcheck editor plugin to check the ePub for errors. I then fix all the errors. Next I remove all unused CSS and in the CSS I add or replace as needed the following code...
Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
p {
  margin-top: 0;
  margin-bottom: 0;
  text-indent: 1.2em;
}
In the CSS I remove all the body font sizes less then 1em. So I make sure that the base text is using the default size. I also remove all the <p class="somebodystyle"> and replace with <p> for most paragraphs. I also clean up all that excess space in chapter headers and any other space I find I don't case for. In most cases, if there is an embedded font, that goes. When I am done, I have an ePub that works very well on my H2O. And the sliders work for whatever I want to line-height and font size.

There is no need to put in a font size for the body text. There is also no need for line-height. Get rid of both as you don't need them. The Kobo has sliders for the line-height and the font size. So pick what you like using the sliders and not a value in CSS that you cannot change. With the CSS code you add, you don't need the font size, the line height, the width, or the padding.
JSWolf is offline   Reply With Quote