04-19-2010, 02:21 PM | #1 |
Member
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. |
04-19-2010, 02:37 PM | #2 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
What was the source format for one of the problem books? Could it have been html?
Quote:
I'm really bad at CSS and conversion settings, so someone else will have to tell you how to remove the color tags. |
|
Advert | |
|
04-19-2010, 02:52 PM | #3 | ||
Member
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
|
Quote:
Quote:
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... |
||
04-19-2010, 06:28 PM | #4 |
Comparer of the Ephemeris
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 |
04-19-2010, 10:49 PM | #5 | ||
US Navy, Retired
Posts: 9,867
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
Quote:
Quote:
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 10:52 PM. |
||
Advert | |
|
04-20-2010, 12:08 AM | #6 |
Member
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. |
04-20-2010, 05:44 AM | #7 |
Wizard
Posts: 4,553
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.
|
04-20-2010, 08:53 AM | #8 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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?
|
04-20-2010, 09:55 AM | #9 | |
Member
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
|
Quote:
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. |
|
04-20-2010, 10:04 AM | #10 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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?
|
04-20-2010, 10:34 AM | #11 | |
Member
Posts: 15
Karma: 10
Join Date: Apr 2010
Device: Stanza on iPhone
|
Quote:
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. |
|
04-20-2010, 12:16 PM | #12 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
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.
|
04-21-2010, 08:53 AM | #13 |
creator of calibre
Posts: 44,573
Karma: 24495948
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.
|
04-23-2010, 06:29 PM | #14 |
Guru
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. |
04-23-2010, 06:34 PM | #15 |
Member
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.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion: A "view newly added books" option | Daemon | Calibre | 5 | 08-23-2010 05:56 AM |
"Geek Squad eReader Set-Up Service" | Mickey330 | General Discussions | 11 | 08-20-2010 12:05 AM |
[Error] Metadata "sequence" tag from FB2 | simonbcn | Calibre | 0 | 08-30-2009 01:20 PM |
BUG: GUI View button not working if Author tag contains "ë" | ShellShock | Calibre | 1 | 11-15-2008 02: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 06:09 AM |