![]() |
#1 |
Enthusiast
![]() 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. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,338
Karma: 203719142
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) |
![]() |
![]() |
![]() |
#4 | |
Enthusiast
![]() Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#5 | |
Enthusiast
![]() Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
Quote:
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 |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,338
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Your trouble is exactly what calibre's output profile and/or font scaling feature is all about.
|
![]() |
![]() |
![]() |
#7 | |
Enthusiast
![]() Posts: 41
Karma: 12
Join Date: Jul 2009
Device: ppc
|
Quote:
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.) |
|
![]() |
![]() |
![]() |
Tags |
font size unit |
|
![]() |
||||
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 |