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 12-10-2009, 11:16 AM   #1
skyfish
Enthusiast
skyfish has learned how to buy an e-book online
 
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.
skyfish is offline   Reply With Quote
Old 12-10-2009, 11:33 AM   #2
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
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.
wallcraft is offline   Reply With Quote
 
Enthusiast
Old 12-10-2009, 11:59 AM   #3
skyfish
Enthusiast
skyfish has learned how to buy an e-book online
 
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.
skyfish is offline   Reply With Quote
Old 12-10-2009, 12:13 PM   #4
skyfish
Enthusiast
skyfish has learned how to buy an e-book online
 
Posts: 32
Karma: 84
Join Date: Jun 2009
Device: NOOK, Win8 tablet, iPad
the zipped file in calibre attached
Attached Files
File Type: zip Dive Into Python - Mark Pilgrim.zip (335.4 KB, 181 views)
skyfish is offline   Reply With Quote
Old 12-10-2009, 12:25 PM   #5
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: 25,622
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can use the extra css conversion setting
kovidgoyal is offline   Reply With Quote
Old 12-10-2009, 12:56 PM   #6
skyfish
Enthusiast
skyfish has learned how to buy an e-book online
 
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
skyfish is offline   Reply With Quote
Old 12-10-2009, 01:08 PM   #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: 25,622
Karma: 4998489
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
kovidgoyal is offline   Reply With Quote
Old 12-10-2009, 01:26 PM   #8
skyfish
Enthusiast
skyfish has learned how to buy an e-book online
 
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. (??)
skyfish is offline   Reply With Quote
Old 12-10-2009, 01:30 PM   #9
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: 25,622
Karma: 4998489
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
yeah.
kovidgoyal 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
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


All times are GMT -4. The time now is 04:38 PM.


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