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 02-17-2017, 09:32 AM   #1
patrik
Guru
patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.
 
Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
Font size changes when using rem (azw3 to epub)

I noticed a new book had a larger than usual base font size and thought that the original book was made like that. But when I compared (with Calibre viewer) the original azw3 the font size is smaller than for the converted epub.

After comparing and testing css's etc. it seems that the original has a base font size set to 0.83rem. This becomes 1.2rem in the converted epub resulting in the larger font size.

Why is this? I have searched the forum and read the calibre manual without finding any clue. The "Disable font size rescaling" is on. I buy most of my books from Amazon and convert books regularly which almost always work fine.

After checking some other books that had the same font size for azw3 and epub, I noticed that all those books have the base font set in em. The problematic book is set in rem. If I just change "rem" to "em", the converted epub uses the exact same value. (There is no font size set in html.)

azw3 font-size: 0.83rem; becomes epub font-size: 1.2rem;
azw3 font-size: 0.83em; becomes epub font-size: 0.83em;

The css class is used in <body class="xxx".


Not a big problem and easily changed, but I'm curious why this happens and what is the best way to get the same font size in the converted epub.
patrik is offline   Reply With Quote
Old 02-17-2017, 09:41 AM   #2
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,680
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Do not convert KF8 to ePub. That's not the best way to do it. Install the KindleUnpack and do a KF8 to ePub and KindleUnpack will shift the KF8 code to ePub. Then load the ePub into the Calibre Editor and check the eBook. Fix any errors that show and when the check shows no errors, you are done and you'll have an ePub that's just like the KF8.
JSWolf is offline   Reply With Quote
Advert
Old 02-17-2017, 09:48 AM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I cannot reproduce, converting the following html
Code:
<!DOCTYPE html>
<html>
    <head>
        <title>test</title>
        <meta charset="utf-8" />
    </head>
    <body>
        <p style="font-size: 0.8rem">Hello i love yuou</p>
    </body>
</html>
results in the following stylesheet.css (with font rescaling turned off)

Code:
.calibre {
    display: block;
    padding-left: 0;
    padding-right: 0;
    margin: 0 5pt
    }
.calibre1 {
    display: block;
    font-size: 0.8rem;
    margin: 1em 0
    }
kovidgoyal is offline   Reply With Quote
Old 02-17-2017, 09:50 AM   #4
patrik
Guru
patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.
 
Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
I do that sometimes but most of the time you get one huge xhtml-file which you may want to split in separate files which takes time, and Calibre-conversions seem to work almost always.

But I just tried doing it with this book, and the font-size in the resulting epub retained the same font size (0.83rem).

But why did Calibre change it? Still curious...

Thanks.
patrik is offline   Reply With Quote
Old 02-17-2017, 09:58 AM   #5
patrik
Guru
patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.
 
Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
Hmm, I just used the ScrambleEbook to send you a copy, but when I convert _that_ azw3 the resulting epub has the same font-size (0.83rem)...???

Is there something strange in my original azw3?
patrik is offline   Reply With Quote
Advert
Old 02-17-2017, 10:38 AM   #6
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,680
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
When you get a single HTML, it's usually a self-published eBook because a lot of self-published authors have no clue how to make an eBook. The real publishers use their ePub version as the source and those ePubs are already split.

I still suggest code shifting even if you have to split into the various chapters/parts.
JSWolf is offline   Reply With Quote
Old 02-17-2017, 10:48 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,320
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Impossible to say without access to the original azw3 -- the one thing to check is to make sure that font rescaling was actually turned off, look at the job log for the ocnversion and search for font_rescaling
kovidgoyal is offline   Reply With Quote
Old 02-17-2017, 03:16 PM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,710
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by patrik View Post
I do that sometimes but most of the time you get one huge xhtml-file which you may want to split in separate files which takes time, and Calibre-conversions seem to work almost always.
@patrik : for conversion to EPUB, try setting the following preferences to create a file per chapter

Conversion->Structure->Detect chapters at (XPath expression): to something other than '/', I use a slightly modified version of the default.

Conversion->Structure->Chapter mark: to pagebreak

Conversion->EPUB Output->Do not split on page breaks : unchecked
BR
BetterRed is offline   Reply With Quote
Old 02-18-2017, 05:13 AM   #9
patrik
Guru
patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.patrik ought to be getting tired of karma fortunes by now.
 
Posts: 682
Karma: 4568205
Join Date: Jan 2010
Location: Sweden
Device: Kobo Forma
Thanks BetterRed.

I do get split files when I use the normal Calibre conversion. It is when I use kindleunpack I end up with the whole book in one single xhtml-file. It is then I want to split up the file, and doing an epub->epub Calibre conversion I assume would negative the point of using kindleunpack in the first place?

(This is mostly a "problem" for me for one certain author-group that makes non-fiction books I like. It seems they start with Word and end up with an azw3 without any headers or internal toc. Since it's an non-fiction I tend to read every now and then and use the toc. Sometimes I have edited a book, changed all title headings to actual <h#> and created a toc. Maybe this can be done automatically by Calibre?)
patrik is offline   Reply With Quote
Old 02-18-2017, 04:05 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,710
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by patrik View Post
It is when I use kindleunpack I end up with the whole book in one single xhtml-file. It is then I want to split up the file, and doing an epub->epub Calibre conversion I assume would negative the point of using kindleunpack in the first place?
I don't buy ebooks from Amazon so I'm not familiar with kindleunpack, but as far as I can make out it converts Amazon's proprietary formats into epub. I wouldn't think a subsequent epub->epub conversion would do any harm, it may even do some good Give it a try.

Quote:
Originally Posted by patrik View Post
(This is mostly a "problem" for me for one certain author-group that makes non-fiction books I like. It seems they start with Word and end up with an azw3 without any headers or internal toc. Since it's an non-fiction I tend to read every now and then and use the toc. Sometimes I have edited a book, changed all title headings to actual <h#> and created a toc. Maybe this can be done automatically by Calibre?)
It should be possible to solve the missing h# headers problem via the Conversion->Structure->Chapter Detection expression, see the XPath Tutorial and that should give you an internal (ncx) TOC. There's also a TOC Tool feature, you may need to add it to a toolbar (that's as much as I know about it).

BR
BetterRed is offline   Reply With Quote
Old 02-18-2017, 06:08 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: 79,680
Karma: 145864619
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 patrik View Post
Thanks BetterRed.

I do get split files when I use the normal Calibre conversion. It is when I use kindleunpack I end up with the whole book in one single xhtml-file. It is then I want to split up the file, and doing an epub->epub Calibre conversion I assume would negative the point of using kindleunpack in the first place?
Yes, converting would negate using KindleUnpack. Use KindleUnpack and then load the ePub into the Editor. If you find it to be too much of a problem to split, then dump the ePub and convert. Otherwise, split. In most cases, it will be OK. So try it.

Quote:
(This is mostly a "problem" for me for one certain author-group that makes non-fiction books I like. It seems they start with Word and end up with an azw3 without any headers or internal toc. Since it's an non-fiction I tend to read every now and then and use the toc. Sometimes I have edited a book, changed all title headings to actual <h#> and created a toc. Maybe this can be done automatically by Calibre?)
With these author group, code shift is best as you'll need to fix it up anyway.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Azw3 to pdf: increase font size bcbob Conversion 2 08-01-2016 04:14 PM
Epub->AZW3 --- embedded font display is wonky GrannyGrump Conversion 2 08-25-2015 06:54 AM
Calibre: epub to azw3 generationg huge file size zamana Conversion 12 01-09-2014 12:36 AM
AZW3 font size help & Identifier question SampleAndy Conversion 7 10-24-2013 09:20 PM
Determine font and font size on incoming epub? peaceridge Calibre 4 01-30-2012 03:35 PM


All times are GMT -4. The time now is 08:45 AM.


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