12-10-2009, 11:16 AM | #1 |
Enthusiast
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
|
single HTML to ePub with fixed width font
I have used calibre for a while but just start to use it to convert ebooks.
I have a programming book in html format (http://www.diveintopython.org/). As all other programming books, it contains code examples that are in fixed width fonts. when calibre convert the book, they are not long fixed width font. How do I make ePub use different fonts for different part of the book? I did a few searches in the forum, but could not use a good search term to find the answer to my question. |
12-10-2009, 11:33 AM | #2 |
reader
Posts: 6,975
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3, Kobo Glo HD
|
The simplest approach is to use the default monospace font. All ePub readers should have one (although I don't know if it has to actually be monospaced). See What's the default ADE font? for an example of using the default fonts. You would probably want other specific CSS features for code display.
|
Advert | |
|
12-10-2009, 11:59 AM | #3 |
Enthusiast
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
|
Can I specify that in conversion setting or I need to edit the html file itself? If editing html file is required, what is the easiest way to do that? sorry, if the answer should be obvious. I am still learning the process.
Thanks! ps. the html file does have a css sheet. see attached. Last edited by skyfish; 12-10-2009 at 12:11 PM. |
12-10-2009, 12:13 PM | #4 |
Enthusiast
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
|
the zipped file in calibre attached
|
12-10-2009, 12:25 PM | #5 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You can use the extra css conversion setting
|
Advert | |
|
12-10-2009, 12:56 PM | #6 |
Enthusiast
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
|
Alright, I could not find any font specified for the monospace font or class in the html and css file. Upon closer look, it uses a lot of <tt ...> and <pre...> tags. I think the book uses tt to specify monospace fonts (many computer books in html do so). Does Calibre process these tags? I am using 0.6.25
|
12-10-2009, 01:08 PM | #7 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yes it does. the question is does whatever epub reading software you're using support them
|
12-10-2009, 01:26 PM | #8 |
Enthusiast
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
|
OK. I was using the ebook viewer of Calibre. the font was not monospace. however when I transfer the book to the sony 505, they are shown as monospace (but wont wrap when the line is too long to fit the screen.
so the file was converted correctly, but the calibre's viewer does not show it right. (??) |
12-10-2009, 01:30 PM | #9 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
yeah.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PRS-300 Fixed-width fonts for text files. | seanhennessy | Sony Reader | 0 | 09-24-2010 11:41 AM |
How to apply fixed-width fonts | EnergyLens | Calibre | 5 | 04-17-2010 12:41 PM |
Several xhtml/html to a single epub file help. | clowe1028 | ePub | 3 | 03-21-2010 03:47 AM |
Fixed-width txt to fluid one | vitalyb | Workshop | 5 | 12-05-2009 08:06 AM |
Wide margins in html to epub; font size mngmt; PDF metadata | dementrio | Calibre | 2 | 08-01-2009 01:33 AM |