Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 09-29-2012, 08:57 PM   #1
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Calibre has no choice on font size unit in css?

During conversion from a recipe or an ebook to an epub, I found in all the rendered css files the font size just uses em unit, like .calibre {...font-size: 1em...}, which gives style to <body> tag in a point of fact.

When I open these epubs with Mantato ereader and the font size is very big, I have to decrease the size again and again.

To solve the problem, I tried many ways to change my extra css in the recipe, no good results at all.

After hard study, I guessed the problem is the em unit in the .calibre element, and you'll find the font size becomes normal after a change from em to % in the converted epubs as the belows, no need to edit other em in the css, just the .calibre.

Origin
.calibre {
display: block;
font-size: 1em;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
page-break-before: always;
text-align: left
}

Change
.calibre {
display: block;
font-size: 80%;
margin-bottom: 0;
margin-left: 5pt;
margin-right: 5pt;
margin-top: 0;
page-break-before: always;
text-align: left
}

Because the Calibre converter has no choice for the unit, and I wish there would be such a unit or % choice there.
naisren is offline   Reply With Quote
Old 09-30-2012, 03:30 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Actually em is the best choice, but it is the same as %. In fact, 1em = 100%. If you put it on 1em, the font size is the default/standard size as defined by your reader.
You must not put it as pt or px, because then resize is no longer possible on the readers.
Toxaris is offline   Reply With Quote
Old 09-30-2012, 07:24 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,532
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Your selected output profile in calibre has a lot to do with the base (default) font size of converted documents.

Also note that calibre has a font scaling feature that you can use for conversions. There's a wizard in the Look & Feel section of the conversion dialogue that allows you to "map" sizes from the input document to the output document.

Calibre user manual (font rescaling)
DiapDealer is offline   Reply With Quote
Old 09-30-2012, 08:09 AM   #4
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Quote:
Originally Posted by Toxaris View Post
Actually em is the best choice, but it is the same as %. In fact, 1em = 100%. If you put it on 1em, the font size is the default/standard size as defined by your reader.
You must not put it as pt or px, because then resize is no longer possible on the readers.
Thanks for your kind reply.
1em = 100%, good point, I tried to change the .calibre font-size to 0.8em in the converted epub, the result is the same as the 80%.
Now the new problem is how to set .calibre font-size to 0.8em throught extra css, I added
body {font-size: 0.8em;}
.calibre{font-size: 0.8em;}
in the template css and extra css, but it is always 1em after the conversion through Calibre Management.

Is there a way to force the .calibre font-size is always 0.8em after the conversion?

Last edited by naisren; 09-30-2012 at 09:43 AM. Reason: I found I am wrong.
naisren is offline   Reply With Quote
Old 09-30-2012, 08:33 AM   #5
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Quote:
Originally Posted by DiapDealer View Post
Your selected output profile in calibre has a lot to do with the base (default) font size of converted documents.

Also note that calibre has a font scaling feature that you can use for conversions. There's a wizard in the Look & Feel section of the conversion dialogue that allows you to "map" sizes from the input document to the output document.

Calibre user manual (font rescaling)
Thanks for your reply.
My trouble is about how to set the font-size by less than 1em (100%) in the body tag (or in .calibre as the above), which seems an important factor to decide the font size for other tags.

Last edited by naisren; 09-30-2012 at 09:30 AM. Reason: try to be reasonable
naisren is offline   Reply With Quote
Old 09-30-2012, 08:43 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,532
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by naisren View Post
Thanks for your reply.
My trouble is about the font-size unit in the body tag (or in .calibre as the above), which seems an important factor to decide the font size for other tags.
Your trouble is exactly what calibre's output profile and/or font scaling feature is all about.
DiapDealer is offline   Reply With Quote
Old 09-30-2012, 09:41 AM   #7
naisren
Enthusiast
naisren began at the beginning.
 
Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
Quote:
Originally Posted by DiapDealer View Post
Your trouble is exactly what calibre's output profile and/or font scaling feature is all about.
Maybe you are right, I tried to believe and do as you suggest, but I could not get the font-size of 0.8em in the body tag after a conversion, no matter how I change the profile or base font-size.
I set the font-size to 0.8em in the body tag before a conversion, but it goes to 1em after the conversion. (My profiles are both default ones.)
naisren is offline   Reply With Quote
Reply

Tags
font size unit

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font size choices with calibre? EldRick Sony Reader Dev Corner 17 03-15-2012 11:28 PM
Can I change heading font size in Calibre? lizzielou Calibre 3 01-21-2012 09:31 AM
Suggestions for font size when using Calibre se007en Sony Reader 2 12-28-2010 06:28 PM
base font size ? What unit should I use ? NASCARaddicted ePub 32 05-13-2010 03:14 PM
Calibre not overwriting ePub CSS font info jswinden Calibre 4 04-06-2010 01:29 PM


All times are GMT -4. The time now is 01:28 AM.


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