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 04-19-2010, 01:21 PM   #1
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
Suggestion: Don't set "color" tag in .epub css

I've been using Calibre for a long time and never seen this, but recently it's happened a couple times. Note: I'm using version x.67, not .68 yet.

I'm converting from several formats to .epub.

After some recent conversions, the .css file in the epub includes the "color" tag and is set to "rgb(0, 0, 0)" [black].

I use Stanza on the iPhone and that is causing the font color to stay black, ignoring any font color settings within the app. When I read at night, I like to set the background to black, and obviously I can't read black text with a black background.

Right now, I'm opening the epub with winzip, then opening stylesheet.css with notepad, then removing all instances where it's setting "color: rgb(0, 0, 0)" and/or "color: XXXX". After doing this, it works as expected in Stanza.

Is this tag necessary for some reason? If not, I'd suggest making sure it's never set - though I don't know how difficult that is to program.

p.s. It also seems to be setting a color for the hyperlink tags "a", but I never have hyperlinks because I only read books.
McAlsop is offline   Reply With Quote
Old 04-19-2010, 01:37 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by McAlsop View Post
I'm converting from several formats to .epub.
What was the source format for one of the problem books? Could it have been html?
Quote:
p.s. It also seems to be setting a color for the hyperlink tags "a", but I never have hyperlinks because I only read books.
You must have had a hyperlink tag in your source book. I suspect your source specified the color as black. If all color is automatically stripped from every book, then you lose some formatting from the original book. For some books it may be critical to have the colored text.

I'm really bad at CSS and conversion settings, so someone else will have to tell you how to remove the color tags.
Starson17 is offline   Reply With Quote
Old 04-19-2010, 01:52 PM   #3
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
Quote:
Originally Posted by Starson17 View Post
What was the source format for one of the problem books? Could it have been html?
Actually never converted from HTML. The specific two I have seen this with are .lrf and .lit.

Quote:
Originally Posted by Starson17 View Post
You must have had a hyperlink tag in your source book. I suspect your source specified the color as black. If all color is automatically stripped from every book, then you lose some formatting from the original book. For some books it may be critical to have the colored text.

I'm really bad at CSS and conversion settings, so someone else will have to tell you how to remove the color tags.
There were a couple hyperlinks, it was setting them to "blue" not black. I just never use them, so I don't care what color they are, but I figured I should mention it.

I honestly don't convert enough ebooks for it to matter to me - I don't mind doing the manual work of deleting the color tags. I just don't see why an ebook should require me to view it in a specific color. I'm guessing the source did specify that font color = black, because I don't have the issue with all .lit and .lrf source files. However, I have yet to read a book, magazine, or newspaper where the font color was important... not to say it can't happen...
McAlsop is offline   Reply With Quote
Old 04-19-2010, 05:28 PM   #4
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
Being able to set text color is used in the catalog for formatting purposes. I for one need calibre to continue to respect color attributes.

G
GRiker is offline   Reply With Quote
Old 04-19-2010, 09:49 PM   #5
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
Quote:
Originally Posted by McAlsop View Post
I'm guessing the source did specify that font color = black, because I don't have the issue with all .lit and .lrf source files.
That would be a good guess, Calibre respects the source as much as possible.

Quote:
Originally Posted by McAlsop View Post
However, I have yet to read a book, magazine, or newspaper where the font color was important... not to say it can't happen...
Many folks read these books on their computer and colored links within the book or to outside sources may be of benefit. In the future as ereaders migrate to an appropriate color format and more ereaders use wireless to connect to the world then colored links will become even more prevalent.

I agree that specifying a default color for the entire document limits the flexibility of that document, but that fault falls squarely at the feet of the initial person or group formatting the book.

I don't have an iPhone or equivalent device so I don't have a need for this, but maybe Calibre could add an option to strip out any color html code during conversion.

Last edited by DoctorOhh; 04-19-2010 at 09:52 PM.
DoctorOhh is offline   Reply With Quote
Old 04-19-2010, 11:08 PM   #6
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
The discussion is why I posted it as a suggestion here instead of adding it to the bug tracker. I still don't see any reason to require text coloring, but obviously a couple people do. I'm not sure anything needs to be added/changed - I just figured other people are (or will be) seeing this problem in Stanza. And I'd guess that any device reading the epub format will respect the black font tags and they might see the issue as well.

On a side note, Stanza has distinct internal settings for background color, font color, and link color. It simply ignores those settings when color is defined in the .css.

And not that it will ever change, but perhaps the eBook readers (like Stanza) that allow you to set font colors should internally ignore font settings.
McAlsop is offline   Reply With Quote
Old 04-20-2010, 04:44 AM   #7
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Stanza also has the option for you to ignore the .css file. This may not always, however, be desireable as other aspects of formatting may be controlled via the .csss file.
itimpi is offline   Reply With Quote
Old 04-20-2010, 07:53 AM   #8
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by itimpi View Post
Stanza also has the option for you to ignore the .css file.
I thought, when I posted, that some CSS guru would be able to specify an override for font color in the Extra CSS conversion. I was thinking of something like color=none for whatever font he's having trouble with. Does anyone know if that's possible?
Starson17 is offline   Reply With Quote
Old 04-20-2010, 08:55 AM   #9
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
Quote:
Originally Posted by itimpi View Post
Stanza also has the option for you to ignore the .css file. This may not always, however, be desireable as other aspects of formatting may be controlled via the .csss file.
This actually did work for one of them, but another one looked pretty funky.

Like I said, I already know how to fix it myself (and described the fix for anyone having a similar problem). I just didn't see a reason that an eBook's font color should be set by the source instead of the reader. But others disagree, which is fine. Though I'm not sure what GRiker's "catalog" is.
McAlsop is offline   Reply With Quote
Old 04-20-2010, 09:04 AM   #10
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by McAlsop View Post
Like I said, I already know how to fix it myself (and described the fix for anyone having a similar problem). I just didn't see a reason that an eBook's font color should be set by the source instead of the reader.
Your fix was to manually edit the file. yes, that works, but if you could just set the override CSS to remove font color, then you'd have the functionality you want, without affecting the font color that others want. That's what the "extr CSS" is for - to override internal CSS so that you get a consistent appearance in converted books, without the variations imposed by different source material. Of course, I have no idea if it's possible to override with a color that is "none." I'm reasonably certain, however, that you can override with color equal to black or white. If you can't force no color, maybe you can have a night version and a day version with font colors forced to white/black?
Starson17 is offline   Reply With Quote
Old 04-20-2010, 09:34 AM   #11
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
Quote:
Originally Posted by Starson17 View Post
Your fix was to manually edit the file. yes, that works, but if you could just set the override CSS to remove font color, then you'd have the functionality you want, without affecting the font color that others want. That's what the "extr CSS" is for - to override internal CSS so that you get a consistent appearance in converted books, without the variations imposed by different source material. Of course, I have no idea if it's possible to override with a color that is "none." I'm reasonably certain, however, that you can override with color equal to black or white. If you can't force no color, maybe you can have a night version and a day version with font colors forced to white/black?
Actually, I don't think it's possible to override the color set within the css in this case.

I know some CSS, which is why I knew where to look for the font color settings. Though, it'd be nice if someone came along who knew otherwise.
McAlsop is offline   Reply With Quote
Old 04-20-2010, 11:16 AM   #12
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by McAlsop View Post
Actually, I don't think it's possible to override the color set within the css in this case.
Yes, I know a bit of CSS, but not enough to tell it to remove color. That's why I said I was terrible at CSS and hoped for a guru. You may well be right that there's no way to specify "none" for the color to override a specific color definition for a font. In that case, an option in the code might well be desirable. I doubt Kovid would make calibre remove color by default, but he might be willing to add it as a checkbox option. There are some similar checkbox overrides already implemented.
Starson17 is offline   Reply With Quote
Old 04-21-2010, 07:53 AM   #13
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,749
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It definitely comes from the source file. Hard to tell you how to override it without the source file in question.
kovidgoyal is online now   Reply With Quote
Old 04-23-2010, 05:29 PM   #14
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
Just wondering... why not a conditional test? Something like:

If background == black
then
text == white
else
text == black

Assuming it is feasible to do this in CSS, it should work for most situations with the exception of dark gray backgrounds with black text.
Sabardeyn is offline   Reply With Quote
Old 04-23-2010, 05:34 PM   #15
McAlsop
Member
McAlsop began at the beginning.
 
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
I don't think it's feasible to do this in CSS... there's no conditional statements as far as I know.
McAlsop 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
Suggestion: A "view newly added books" option Daemon Calibre 5 08-23-2010 04:56 AM
"Geek Squad eReader Set-Up Service" Mickey330 General Discussions 11 08-19-2010 11:05 PM
[Error] Metadata "sequence" tag from FB2 simonbcn Calibre 0 08-30-2009 12:20 PM
BUG: GUI View button not working if Author tag contains "ë" ShellShock Calibre 1 11-15-2008 01:21 PM
Lawrence Lessig's "The Future of Ideas" set free adinb Deals and Resources (No Self-Promotion or Affiliate Links) 10 01-21-2008 05:09 AM


All times are GMT -4. The time now is 07:54 AM.


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