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 03-05-2013, 09:53 PM   #1
slpatters
Junior Member
slpatters began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2013
Device: iPad
Font color not being converted correctly

I have an ebook in MOBI format that has coding samples in it which are color coded. When I use Calibre to convert it to ePub the font face and colors are not converted. How can I preserve fonts?

Here are examples (also screenshots attached):

MOBI - main text is in Arial, but code segment is in Courier with grey background (I can't figure out how to show grey background here)
The first thing you’ll notice is that Objective-C uses a completely different syntax for communicating between objects. For example, compare the method calling syntax of C# to the message sending syntax of Objective-C:

person.sayHello(); // C# method calling.
[person sayHello ]; // Objective-C message sending.

EPUB - main text is in Arial, but code segment is in Arial with no highlight
The first thing you’ll notice is that Objective-C uses a completely different syntax for communicating between objects. For example, compare the method calling syntax of C# to the message sending syntax of Objective-C:

person.sayHello(); // C# method calling.
[person sayHello ]; // Objective-C message sending.
Attached Thumbnails
Click image for larger version

Name:	MOBI.png
Views:	60
Size:	18.5 KB
ID:	102354   Click image for larger version

Name:	EPUB.png
Views:	48
Size:	17.3 KB
ID:	102355  
slpatters is offline   Reply With Quote
Old 03-05-2013, 10:44 PM   #2
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: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 03-06-2013, 12:22 AM   #3
slpatters
Junior Member
slpatters began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2013
Device: iPad
Source file

1. The book is copyrighted, but you can download the source book from here:
http://www.syncfusion.com/resources/...ks/objective-c

2. Go the the Introduction page and under the "The Objective-C Language" section and you will see the "code" shown in my message and in the screenshots attached to first message.

3. Now, convert it to EPUB using default settings (or for the iPad 3)

4. Open the EPUB version and go to the same page. The "code" will not have the same color formatting. It will all be black text.
slpatters is offline   Reply With Quote
Old 03-06-2013, 02:04 AM   #4
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: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That book use @import rules inside <style> tags, this is not supported by the calibre conversion pipeline. I suggest you use the calibre tweak book feature, and change those to use normal <link> tags for the stylesheets, then convert and you will be fine.

Or wait for the next calibre release.
kovidgoyal is offline   Reply With Quote
Old 03-06-2013, 02:15 AM   #5
slpatters
Junior Member
slpatters began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2013
Device: iPad
I appreciate your patience. Please forgive my ignorance, but I am not familiar with
Quote:
use calibre tweak book feature, and change those to use normal <link> tags for the stylesheets,
Where can I find this?

Also, when do you expect the next version to be available?
slpatters is offline   Reply With Quote
Old 03-06-2013, 08:28 AM   #6
PeterT
Taking a break; Fed up
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 7,378
Karma: 46288753
Join Date: Nov 2007
Location: Toronto
Device: Wife: Touch, Arc, Vox Me: Nexus 7, Glo
Quote:
Originally Posted by slpatters View Post
Also, when do you expect the next version to be available?
This coming Friday; kovid keeps to a release a week schedule.
PeterT is offline   Reply With Quote
Old 03-06-2013, 11:28 AM   #7
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,913
Karma: 4329601
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by slpatters View Post
Where can I find this?
You can access the Tweak ebook feature by selecting the particular book in the main calibre library window, then press T
jackie_w is offline   Reply With Quote
Old 03-06-2013, 05:11 PM   #8
slpatters
Junior Member
slpatters began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2013
Device: iPad
Quote:
Originally Posted by PeterT View Post
This coming Friday; kovid keeps to a release a week schedule.
Thanks, PeterT.


Quote:
Originally Posted by jackie_w View Post
You can access the Tweak ebook feature by selecting the particular book in the main calibre library window, then press T
Thanks, jackie_w. I tried that and that option seems "scary" to me. I have no idea what to do that will not corrupt the book. Since PeterT says that a new version is due on Friday (two days away) I will wait to see if that fixes my issue. If not, I'll need more help.

Thank you both again!
slpatters is offline   Reply With Quote
Reply

Tags
calibre, epub, font colour, mobi

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Color Can a Russian jetbook color be converted to english? gil Ectaco jetBook 3 03-24-2013 08:44 PM
Am I using @font-face correctly? phossler Sigil 12 11-30-2012 05:38 PM
Gentium Book font (ttf) doesn't render correctly therealjoeblow Kobo Reader 12 09-08-2011 12:23 AM
PRS-650 Font too small - Calibre converted henders254 Sony Reader 14 06-09-2011 04:04 AM
Converted ePub file displays correctly in Calibre Viewer, but not on Sony library addict Conversion 6 03-24-2011 10:58 AM


All times are GMT -4. The time now is 07:42 PM.


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