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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-07-2010, 08:18 PM   #1
Sylver
Addict
Sylver began at the beginning.
 
Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
How to increase the line space in CSS

Hi, I am converting txt files to epub for reading on the nook using Calibre. As I need to use my own fonts for the Chinese, I put the following script into the .css box to have it use my own fonts that I put on the sd card. Everything works well except the space between the lines is to small (literally each line is followed immediately by another line without any space), I changed the font size in the nook and the space between lines does not change at all. I am sure it's a simple edit on the script that follows, but have no idea how to set it, can someone help? many thanks.

@font-face {
font-family: "MSYaHei";
font-weight: normal;
font-style: normal;
src: url(res:///sdcard/font/msyh.ttf);
}
@font-face {
font-family: "MSYaHei";
font-weight: bold;
font-style: normal;
src: url(res:///sdcard/font/msyhbd.ttf);
}

body { font-family: "MSYaHei", serif;}
Sylver is offline   Reply With Quote
Old 08-07-2010, 11:00 PM   #2
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,884
Karma: 4200035
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
I know nothing about Chinese fonts but you could try adding a line-height to the body element e.g

Code:
body { font-family: "MSYaHei", serif; line-height:200%}
...then play about with the 200% until it suits.
jackie_w is offline   Reply With Quote
Old 08-08-2010, 01:57 AM   #3
Sylver
Addict
Sylver began at the beginning.
 
Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
Quote:
Originally Posted by jackie_w View Post
I know nothing about Chinese fonts but you could try adding a line-height to the body element e.g

Code:
body { font-family: "MSYaHei", serif; line-height:200%}
...then play about with the 200% until it suits.
Thanks, I actually just noticed on the on Look & Feel tab, you can specify line height by points which worked for me.
Sylver is offline   Reply With Quote
Old 08-08-2010, 02:02 AM   #4
Sylver
Addict
Sylver began at the beginning.
 
Posts: 234
Karma: 40
Join Date: Apr 2010
Device: The Nook, iPad
After unzip the compiled file and checked the css, it says "line-height: 1.5em;", I used base font size of 16 and put in the line-height as 24 which is exactly 1.5 times of the base font. Not sure what "em" stands for, but it does make sense. Thanks again, Jackie_w.
Sylver is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS for line breaks after dashes? JaneFancher Sigil 4 04-05-2010 01:18 PM
Strange increase in contrast mmmkay Sony Reader 12 12-18-2009 12:40 AM
How to increase picture size? luqmaninbmore PocketBook 1 11-13-2009 09:40 PM
price increase ? Loopy65 Bookeen 7 06-24-2008 06:41 PM
I can not increase the size or the letters Treomaniaco Sony Reader 4 02-01-2008 07:03 PM


All times are GMT -4. The time now is 08:37 PM.


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