Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Viewer

Notices

Reply
 
Thread Tools Search this Thread
Old 01-24-2013, 01:04 PM   #166
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
Yeah, with the style sheet. This is what I have:

Quote:
body {
background-image:url("file:///C:/Program Files (x86)/Calibre2/resources/images/Back.jpg");
}
I tried your suggestion in various combinations with the above but all just made the background picture disappear.
Vortex is offline   Reply With Quote
Old 01-25-2013, 12:36 AM   #167
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)
Vortex,
Take a look at Message #147 by Cyberxaos. Based on that message, it appears that these are two separate commands that should be entered on different lines in the CSS. Hope this helps!


PS: I find the use of the Book's Spine quite an interesting affect.
Sabardeyn is offline   Reply With Quote
Old 01-25-2013, 01:50 PM   #168
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
Thanks Sabardeyn, That's it. Now looks like this, (is there any way to turn off the slidey thing on the right?)

Click image for larger version

Name:	backincalibre.jpg
Views:	780
Size:	365.7 KB
ID:	161062

Quote:
Sabardeyn; PS: I find the use of the Book's Spine quite an interesting affect.
You mean in this picture? Yes, it works well on a reasonable size screen. It was originally a lot narrower which made the buttons difficult to click on an old touch screen, so I played with the ubook software code until I figured out how to make it wider. I'm really pleased with how it came out just wish I could get Calibre to output to it automatically, I tried the 'open with' plugin but it outputs .HTMLZ which ubook cant open without renaming the file to .ZIP - maybe there's a plugin that'll do that...

Click image for larger version

Name:	trevbook.jpg
Views:	595
Size:	115.4 KB
ID:	161063

Last edited by WT Sharpe; 12-30-2017 at 09:53 AM. Reason: Changed oversized graphic to thumbnail attachment.
Vortex is offline   Reply With Quote
Old 01-25-2013, 02:35 PM   #169
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)
Sorry, I'm not aware of a way to turn off the slider on the right. It may be possible, but if it is, the next avalible calibre guru will have to chime in.
Sabardeyn is offline   Reply With Quote
Old 01-26-2013, 06:13 PM   #170
Vortex
Groupie
Vortex began at the beginning.
 
Vortex's Avatar
 
Posts: 171
Karma: 10
Join Date: Dec 2008
Device: Likebook Mars
Found the tick box to turn off the scrollbar, under Fullscreen Options.

Is it possible to specify the font in the CSS stylesheet so it over rides what's embedded in the books?
Vortex is offline   Reply With Quote
Old 01-26-2013, 08:01 PM   #171
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
Since the expansion of the viewer preferences many things that previously required style sheet changes can be changed in the preferences.

Quote:
Originally Posted by Vortex View Post
Is it possible to specify the font in the CSS stylesheet so it over rides what's embedded in the books?
When the viewer is open click on the viewer preferences icon in the toolbar and change the font to anything you want.
DoctorOhh is offline   Reply With Quote
Old 01-26-2013, 10:57 PM   #172
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,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by DoctorOhh View Post
When the viewer is open click on the viewer preferences icon in the toolbar and change the font to anything you want.
This will not override fonts specified in the book. For that you should do an conversion and use filter css to remove the fonts.
kovidgoyal is offline   Reply With Quote
Old 01-26-2013, 11:39 PM   #173
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 kovidgoyal View Post
This will not override fonts specified in the book. For that you should do an conversion and use filter css to remove the fonts.
Thanks for the clarification, when I tested I forgot I have already removed any fonts from 98% of my books.
DoctorOhh is offline   Reply With Quote
Old 01-30-2013, 12:58 PM   #174
dob
Junior Member
dob began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2013
Device: Kindle
Angry Background colour

I tried copying and pasting this code into the Calibre stylesheet and got a completely white page with no printing on it.
Whatever I try in background-color:rgb(0,0,0); doesn't change the background colour.
Changing the color changes the print color. What is going wrong?
I am a complete greenhorn with regard to this programming.
I am running Windows 7 on a Acer laptop. Please help.

Quote:
Originally Posted by ekaser View Post
You have an error in there. I was testing out a completely different color scheme (harking back to the "good old" MS-DOS days), when I used WHITE on BLUE background for my console (worked better then, with fixed pitch, large fonts :-). In your code above, you need to add a ':' after the body 'color' name. Without it, the body (text) color is ignored. It still works for what you want, because the default color is black. But it doesn't work if you try to set it to anything else. Not necessarily pleasing to use, but as another example, here's my "white on blue" style:

body {
color: rgb(255,255,255);
background-color:rgb(0,0,255);
text-align:justify;
line-spacing:1.8;
margin-top:0px;
margin-bottom:4px;
margin-right:50px;
margin-left:50px;
text-indent:2em;
}
h1, h2, h3, h4, h5, h6 {
color:white;
text-align:center;
font-style:italic;
font-weight:bold;
}
dob is offline   Reply With Quote
Old 03-04-2013, 10:55 PM   #175
ghudod
Connoisseur
ghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toysghudod shares his or her toys
 
Posts: 56
Karma: 5502
Join Date: Oct 2012
Device: none
Is there any way I can set the margins in terms of percentage of the window? For example, I like to read with the viewer covering about half the screen while I do something else, and my margin settings of 400px reduces the text on every line to a single word! If instead I could set the margin as a percentage, it would be greatly helpful. Here's the code, taken from some other contributor in this thread:

Quote:
body {color:RGB(0,0,0) !important;
background-color:RGB(228,226,224) !important;
text-align:justify !important;
line-height:1.2 !important;
margin-top:0px !important;
margin-bottom:4px !important;
margin-right:400px !important;
margin-left:350px !important;
text-indent:5em !important;
background-image:url("http://img33.imageshack.us/img33/2545/calibrebackground.png") !important;
background-position:50% !important;}
p,div {margin-bottom:8px !important;margin-top:8px !important;}
blockquote {padding-right:35px !important;margin-bottom:8px !important;}
h1, h2, h3, h4, h5, h6
{color:black !important;
text-align:center !important;
font-style:italic !important;
font-weight:bold !important;}
I'm a noob to this and don't know any CSS. Please help to set the margin-left and margin-right values to percentages if possible!
ghudod is offline   Reply With Quote
Old 03-17-2013, 08:09 PM   #176
Brokkoli
Junior Member
Brokkoli began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Mar 2013
Device: calibre
Help!! Calibre overrides my CSS stylesheet


This is a line from my css, trying to make code look good:

Code:
.programlisting {
    font-family: "Anonymous Pro";
}
However, Calibri overrides it with its own stylesheet.css. I can right-click -> inspect element -> Computed Style --> Font-Family
And this is what is shows:

Code:
font-family: monospace;
.programlisting - monospace stylesheet.css:204
.programlisting - 'Anonymous Pro' user stylesheet
pre, xmp, plaintext, listing - monospace user agent stylesheet
body - georgia
So it tries to apply my setting but then overrides it with its own stylesheet!!?

Any help appreciated.
Brokkoli is offline   Reply With Quote
Old 03-18-2013, 01:57 AM   #177
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,744
Karma: 22446736
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That's a stylesheet in your book, not one generated by calibre. You have to use !important to override the book's styles in your custom stylesheet or use filter css and do a conversion to remove the css from the book.
kovidgoyal is offline   Reply With Quote
Old 04-13-2013, 03:05 PM   #178
AnnieWalker
Junior Member
AnnieWalker began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2012
Device: Kindle Paperwhite Wi-Fi
Quote:
Originally Posted by sideburnt View Post
If you're interested in CSS Styling take a quick look at
http://epubzengarden.com/?style=trad.../chapter1.html

Its a very new site but could become fantastic with a bit of contribution.

Hard to navigate around and took me a while to find the css preview page, I have linked to my favorite page style used on this site.
The last style there, "wallpaper", is amazing. Could someone help me applying it to my calibre?
AnnieWalker is offline   Reply With Quote
Old 04-14-2013, 02:06 AM   #179
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 AnnieWalker View Post
The last style there, "wallpaper", is amazing. Could someone help me applying it to my calibre?
I can help you with the basics of that style. One caveat, these instruction are for a Windows based computer.

First you have to grab the background image from the web page (http://epubzengarden.com/images/bg1.jpg) and save it to your computer. Right click the link and select Save link as if using Firefox or Save target as if using Internet Explorer. Save this file in a location on your hard drive, it doesn't matter where but you will need to obtain the file path to this image.

1. Now open any book in calibre's viewer and then open preferences. Now go to he User style tab (see attached) and paste the following. Replace the green colored path below with your actual path on your machine to the image.

Code:
body { background-image:url("file:///C:/Dropbox/Calibre Portable/Calibre Settings/resources/images/bg1.jpg") !important;
 }
2. Now go to the General tab and click on Colors and backgrounds row then click on the Change button next to text color (see attached) and fill in the following values:

Red: 68
Green: 51
Blue: 0

Click OK Then click OK again. Your book in calibre viewer should have the same background and text color as the example you cited. If it doesn't then review the path you set in step 1 above, ensure all slashes are in the same direction as I indicated and that it does point to the file's exact location on your machine.

3. Now that the background and font color are set open preferences again and go to the Theming tab (see attached). Click the Save button and enter a title for this theme. Click OK then OK again. Now you have saved this theme and if you decide to experiment further you can always go back to this theme via the Load button.
Attached Thumbnails
Click image for larger version

Name:	user_style.jpg
Views:	954
Size:	70.6 KB
ID:	104339   Click image for larger version

Name:	colorsandbackgrounds.jpg
Views:	920
Size:	125.4 KB
ID:	104340   Click image for larger version

Name:	theme_tab.jpg
Views:	827
Size:	75.8 KB
ID:	104341  

Last edited by DoctorOhh; 04-14-2013 at 02:08 AM.
DoctorOhh is offline   Reply With Quote
Old 04-14-2013, 10:21 AM   #180
AnnieWalker
Junior Member
AnnieWalker began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Oct 2012
Device: Kindle Paperwhite Wi-Fi
Incredible. Thanks for making it so easy. I've applied them in 5secs...but it seems that I can't override text alignment setting of the file to justify even with "text-align:justify !important;" line. Do you have a solution for this, too?

I appreciate your help.


AnnieWalker 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
Custom CSS for output deckoff Calibre 1 08-28-2010 11:55 PM
ePub with custom .css on a 505 dicknskip Sony Reader Dev Corner 3 06-09-2010 11:34 PM
User stylesheets for ePub files salty-horse Sony Reader Dev Corner 12 02-23-2010 07:44 AM
ePub conversion: override existing css with a custom one sbin Calibre 1 01-09-2010 04:03 AM
Calibre's generated css for epub brewt Calibre 7 12-29-2008 09:59 AM


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


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