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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 05-10-2010, 06:59 PM   #1
tselling
Addict
tselling will become famous soon enoughtselling will become famous soon enoughtselling will become famous soon enoughtselling will become famous soon enoughtselling will become famous soon enoughtselling will become famous soon enough
 
Posts: 366
Karma: 510
Join Date: Apr 2008
Device: NookColor (MiRage/CM7.2 & Moon+ Reader Pro)
userstyle.css and epub margins

Has anyone had any luck reducing the margins on their sony reader using userstyle.css? I have been able to use my preferred font (Aller) with a russian hack that allows a user accessible userstyle.css but changing the margins doesn't seem to do anything. I understand that justification cannot be changed currently, and am wondering if the margins are the same.

If someone has been able modify the margins and have it work on their reader, could you provide your userstyle.css please. I am using a prs-300 but I think any reader hacked with accessible userstyle.css should be the same.
Thanks.
tselling is offline   Reply With Quote
Old 10-16-2010, 01:34 AM   #2
terrythiel
Junior Member
terrythiel began at the beginning.
 
Posts: 4
Karma: 19
Join Date: Jul 2010
Device: Sony PRS300
epub margins and fonts changes for Sony reader

Some epub books have wide margins on my Sony PRS300. Using Calibre I was able to remove margins that did not seem to respond to changing the margin settings in Calibre's "page setup" menu.

Open Calibre
Make a copy of the book you are altering (in case of serious problems with the conversion)
  • Go to the drop down menu on the right of the “Add book” menu symbol and add an “empty book”.
  • In the library list, select the empty book and holding down the Ctrl button select the book you want to copy (in that order!)
  • With both books selected hold down Alt and M keys to make a copy of the book
Select the copy of the Book title in library
  • right click the book and select “tweak epub” from the drop down menu
  • Explode epub
  • Delete the .XPGT file from the OEBPS folder.
  • Rebuild epub

In Calibre
Select book title in library
  • Click on “Convert books” to go to the conversion options page for the book
  • In “page setup” set the margins to whatever you want (0 is fine if you want no margin)
  • Save and upload book to reader

I also changed fonts with instructions I found here:
http://blog.the-ebook-reader.com/201...a-sony-reader/
terrythiel is offline   Reply With Quote
 
Advertisement
Old 10-17-2010, 03:59 PM   #3
ShellShock
Guru
ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.ShellShock ought to be getting tired of karma fortunes by now.
 
ShellShock's Avatar
 
Posts: 982
Karma: 2199790
Join Date: Sep 2008
Device: IPad Mini Retina, Kobo Aura HD
You need to be careful when deleting the xpgt file, because it also controls top and bottom margins. For example, the xpgt will often determine the top margin for a new chapter--if you delete it the chapter will begin at the top of the screen, rather than half way down.
ShellShock is offline   Reply With Quote
Old 10-20-2010, 07:56 AM   #4
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
Quote:
Originally Posted by tselling View Post
If someone has been able modify the margins and have it work on their reader, could you provide your userstyle.css please. I am using a prs-300 but I think any reader hacked with accessible userstyle.css should be the same.
Thanks.
@page {
margin-left:5px;
margin-right:2px;
margin-top:7px;
margin-bottom:1px
}

I used this on the PRS-600, and now on the PRS-650, but you have to remove similar settings from the css file inside the epub, if there is one.
goaspy is offline   Reply With Quote
Old 10-21-2010, 10:07 PM   #5
terrythiel
Junior Member
terrythiel began at the beginning.
 
Posts: 4
Karma: 19
Join Date: Jul 2010
Device: Sony PRS300
To which e-pub file would I add

@page {
margin-left:5px;
margin-right:2px;
margin-top:7px;
margin-bottom:1px
}

Does it matter where it is placed?
terrythiel is offline   Reply With Quote
Old 10-22-2010, 02:25 AM   #6
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
I have it in the userStyle.css file exposed my the russified firmware, on the reader, after the @font-face region.

I also set margins to zero in other elements.

body {
margin-left:0;
margin-right:0;
margin-top:0;
margin-bottom:0
}

@page {
margin-left:5px;
margin-right:2px;
margin-top:7px;
margin-bottom:1px
}

p {
text-indent:32px;
text-align: justify;
margin-left:0;
margin-right:0;
margin-top:0;
margin-bottom:0;
word-spacing:130%;
line-height:131%;
font-family:"Liberation";
font-size:106%;
color:black;
widows:1;
orphans:1
}
goaspy is offline   Reply With Quote
Old 10-22-2010, 08:47 PM   #7
terrythiel
Junior Member
terrythiel began at the beginning.
 
Posts: 4
Karma: 19
Join Date: Jul 2010
Device: Sony PRS300
Thanks - I also have the russified firmware - love the clock!

I will try your settings.
terrythiel is offline   Reply With Quote
Old 10-28-2010, 11:10 AM   #8
terrythiel
Junior Member
terrythiel began at the beginning.
 
Posts: 4
Karma: 19
Join Date: Jul 2010
Device: Sony PRS300
Does a userstyle.css file on the reader override the userstyle.css file included in the epub file or vice versa?
terrythiel is offline   Reply With Quote
Old 10-28-2010, 02:51 PM   #9
goaspy
Connoisseur
goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.goaspy can eat soup with a fork.
 
goaspy's Avatar
 
Posts: 77
Karma: 9324
Join Date: Feb 2010
Device: Sony PRS-650, Kindle 3
Quote:
Originally Posted by terrythiel View Post
Does a userstyle.css file on the reader override the userstyle.css file included in the epub file or vice versa?
If a css file exists inside the epub, it will override settings from the css file on the reader. I usually delete settings from the embedded file, but only what I know it's covered by the reader's stylesheet.

If the epub doesn't have a css file inside, the reader's sheet overrides a style defined inside the html/xhtml file: "...<style type="text/css">@page{margin:30px}body{font-family: ..."
goaspy 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
Is there a way to over ride CSS Margins gandor62 Calibre 0 09-21-2010 10:40 PM
ePub margins : @page vs stylesheet.css Agama Calibre 1 08-16-2010 05:37 PM
ADE mit userstyle css mtravellerh PocketBook 0 05-21-2010 04:40 PM
user accessable userStyle.css please tselling PocketBook 9 05-19-2010 09:02 PM
css override code for margins? Amalthia Calibre 15 08-11-2009 08:20 PM


All times are GMT -4. The time now is 08:59 AM.


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