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, 08: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:	281
Size:	18.5 KB
ID:	102354   Click image for larger version

Name:	EPUB.png
Views:	280
Size:	17.3 KB
ID:	102355  
slpatters is offline   Reply With Quote
Old 03-05-2013, 09: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: 43,778
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://www.mobileread.com/forums/sho...d.php?t=186697
kovidgoyal is offline   Reply With Quote
Old 03-05-2013, 11:22 PM   #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, 01: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: 43,778
Karma: 22666666
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, 01: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, 07:28 AM   #6
PeterT
Grand Sorcerer
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: 12,119
Karma: 73448614
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
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, 10:28 AM   #7
jackie_w
Grand Sorcerer
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: 6,171
Karma: 16228536
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
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, 04: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
Gentium Book font (ttf) doesn't render correctly therealjoeblow Kobo Reader 13 06-21-2015 09:24 AM
Color Can a Russian jetbook color be converted to english? gil Ectaco jetBook 3 03-24-2013 07:44 PM
Am I using @font-face correctly? phossler Sigil 12 11-30-2012 04:38 PM
PRS-650 Font too small - Calibre converted henders254 Sony Reader 14 06-09-2011 03:04 AM
Converted ePub file displays correctly in Calibre Viewer, but not on Sony library addict Conversion 6 03-24-2011 09:58 AM


All times are GMT -4. The time now is 05:57 AM.


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