Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2020, 02:48 PM   #1
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
easiest way to normalize font size when converting

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.
hobnail is offline   Reply With Quote
Old 01-06-2020, 03:12 PM   #2
exaltedwombat
Guru
exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.exaltedwombat ought to be getting tired of karma fortunes by now.
 
Posts: 878
Karma: 2457540
Join Date: Nov 2011
Device: none
I suggest you leave the file alone and adjust the text size (if required) using the controls in your reader device or software.
exaltedwombat is offline   Reply With Quote
Advert
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: 74,537
Karma: 129670952
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
Old 01-06-2020, 03:53 PM   #4
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by exaltedwombat View Post
I suggest you leave the file alone and adjust the text size (if required) using the controls in your reader device or software.
That's exactly what I want to avoid.
hobnail is offline   Reply With Quote
Old 01-06-2020, 03:53 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,944
Karma: 55705602
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
My reply somewhat goes against Jons, but only for Personal use. For production, there are publisher guidelines to follow.
But I do agree: Do styling in the CSS ONLY

First 1em is the usual default, therefore redundant for block level tags, so those>>>Gone .

The first pass of Diaps toolbag blows away spans that only set fonts to 1em (CSS review is needed before any bulk surgery )
Where I differ, I set my body font UP to 1.2em and blow away all those 0.758 that are common from a calibre conversion .

BODY is my baseline. Note that Jon's simple <p> works perfect for the majority of Paragraphs. IMHO Styles are for EXCEPTIONS to the defaults or baseline.
1.2 seems to be a standard default for line-height, so why put it in most places (there are reasons, I do: Dropcap lines seem to need this to keep ugly spacing at bay.

Border and padding defaults to 0. gone. OTOH Margin seems to default to 1, so you may want to keep/adjust that.
Large and smaller fonts have their place (uses), which is why I abhor blanket destruction. If the book WAS well formatted, it only takes a couple of minutes to touch it up (via CSS) without willy-nilly destruction .
BTW This is one of the reasons I prefer Sigil for my cleanups. It has a jump to CSS selector of the current tag. YMMV
theducks is online now   Reply With Quote
Advert
Old 01-06-2020, 03:55 PM   #6
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by JSWolf View Post
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.
Thanks, I'll try that next time.
hobnail is offline   Reply With Quote
Old 01-06-2020, 04:01 PM   #7
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by JSWolf View Post
Code:
body {
  widows: 1;
  orphans: 1;
  margin-top: 0;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
  text-align: justify;
}
Do you need the text-align:justify;? I remove all text-align lines and set the alignment in the ereader's settings. For brevity you could replace all of those margin lines with a single margin:0;.
hobnail is offline   Reply With Quote
Old 01-06-2020, 04:06 PM   #8
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by theducks View Post
My reply somewhat goes against Jons, but only for Personal use.
...
BTW This is one of the reasons I prefer Sigil for my cleanups. It has a jump to CSS selector of the current tag. YMMV
Mine is similar to yours. I also delete all of the line-height lines. I also delete all of the fonts, even if they're only for the headers. The built in Caecilia font works very well for me.

I need to remember that jump to CSS selector thing.
hobnail is offline   Reply With Quote
Old 01-06-2020, 04:10 PM   #9
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by theducks View Post
The first pass of Diaps toolbag blows away spans that only set fonts to 1em (CSS review is needed before any bulk surgery ).
I didn't know about his toolbag; I'll try that next time.
hobnail is offline   Reply With Quote
Old 01-06-2020, 06:00 PM   #10
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: 74,537
Karma: 129670952
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
Do you need the text-align:justify;? I remove all text-align lines and set the alignment in the ereader's settings. For brevity you could replace all of those margin lines with a single margin:0;.
I prefer the text justified. I remove all text-align: left. I suppose I could remove it as the Kobo will let me set the text to be justified. You cannot remove all text-align. You need the ones that are centered and right aligned.

As for the margin: 0, I rather dislike the margin shorthand.
JSWolf is offline   Reply With Quote
Old 01-06-2020, 06:01 PM   #11
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: 74,537
Karma: 129670952
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
Mine is similar to yours. I also delete all of the line-height lines. I also delete all of the fonts, even if they're only for the headers. The built in Caecilia font works very well for me.

I need to remember that jump to CSS selector thing.
You can use the Calibre editor as it has a similar feature. In the live CSS panel, you can click the CSS link or each class to go to that class in the CSS. It works very well.
JSWolf is offline   Reply With Quote
Old 01-06-2020, 08:41 PM   #12
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by JSWolf View Post
I prefer the text justified. I remove all text-align: left. I suppose I could remove it as the Kobo will let me set the text to be justified. You cannot remove all text-align. You need the ones that are centered and right aligned.
Right, I meant to say that I remove the ones where it's either justify or left.
hobnail is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
font size changing when converting lumpynose ePub 16 05-12-2019 02:46 PM
Converting to PDF ... Font size to big steve257 Conversion 5 02-07-2014 03:11 AM
Changing font size after converting Pdf to Kindle Findlay Conversion 6 03-18-2011 05:59 PM
Increasing the font size when converting PDF Anonymouslemming LRF 4 05-28-2010 03:39 AM
libprs500 converting font size socalpimp Calibre 1 11-15-2007 01:07 AM


All times are GMT -4. The time now is 03:47 AM.


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