Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 02-17-2013, 07:04 PM   #1
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
PRS+ custom formatting is inconsistent

I just installed PRS+ on my reader. I loaded the fonts and I loaded a custom CSS file as follows:

@font-face {
font-family: "Charis";
font-weight: normal;
font-style: normal;
src: url(res:///Data/fonts/CharisSILR.ttf);
}
@font-face {
font-family: "Charis";
font-weight: bold;
font-style: normal;
src: url(res:///Data/fonts/CharisSILB.ttf);
}
@font-face {
font-family: "Charis";
font-weight: normal;
font-style: italic;
src: url(res:///Data/fonts/CharisSILI.ttf);
}
@font-face {
font-family: "Charis";
font-weight: bold;
font-style: italic;
src: url(res:///Data/fonts/CharisSILBI.ttf);
}
body {
font-family: "Charis";
text-align:justify;
font-size: medium;
line-height: 3.2em;
margin-top: 1em;
margin-left: 1em;
margin-right: 1em;
}

(I used that huge line height to test if the line height was being respected or not.)

When I open books, some of them are using the Charis font, and some are not. The books that are not using the Charis font are not using a custom font, they are using the default Sony font. Some of these books are using the default Sony font, but they have the margins and line-height that I set. Some books *are* using the Charis font, but the margins and line-height are not being respected. One book had a huge margin when I loaded it, and it still has a huge margin now.

What's going on here?

eP
elemenoP is offline   Reply With Quote
Old 02-19-2013, 03:45 PM   #2
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
and also: when I power off the unit, it takes about 5 or 6 seconds (forever!) from the time I slide the power slider until it turns off. Is that normal? Powering on is normal (no lag).

eP
elemenoP is offline   Reply With Quote
Advert
Old 02-21-2013, 03:07 AM   #3
Mark Nord
2B || !2B
Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.
 
Posts: 851
Karma: 194010
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Welcome to PRS+ and the world of CSS

As CSS already implies, Cascading Style Sheets, there are many possibilities to get the format you want.

In your example you are setting font-family for body.

If an embedded CSS forces font-family lets say for the p-tag you are out of luck.
Your best guess is to check the embedded CSS with Sigil, or flatten them with Calibre.

Quote:
and also: when I power off the unit, it takes about 5 or 6 seconds (forever!) from the time I slide the power slider until it turns off. Is that normal? Powering on is normal (no lag).
It depends.
A) on the setting for Standby-Screen
B) the current ebook-file

With some formats it will take a while to generate the standby image.
Though 5 seconds and more are rather long (for a x50, more often seen with 300/505)
Please try some other books and formats, too. (epub, pdf, lrf)
Mark Nord is offline   Reply With Quote
Old 02-21-2013, 04:09 PM   #4
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,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@elemenoP,

Try these simple changes (in red) in your custom Charis css file. This should increase the number of your epubs which 'just work':
Code:
@font-face { 
	font-family: serif; 
	font-weight: normal; 
	font-style: normal; 
	src: url(res:///Data/fonts/CharisSILR.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: bold; 
	font-style: normal;
	src: url(res:///Data/fonts/CharisSILB.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: normal; 
	font-style: italic; 
	src: url(res:///Data/fonts/CharisSILI.ttf); 
}
@font-face { 
	font-family: serif; 
	font-weight: bold; 
	font-style: italic; 
	src: url(res:///Data/fonts/CharisSILBI.ttf); 
}
body, body.book, body.text, body.calibre, body.calibre1, body.calibre2, body.calibre3, body.calibre4 { 
	font-family: serif;
	text-align:justify;
	font-size: 1em;
	line-height: 3.2em;
	margin-top: 1em;
	margin-left: 1em;
	margin-right: 1em;
}
You will still have some epubs which don't work, in which case you need to do as Mark suggests and take a look at the internal css in the epub. You can only do this for non-DRM epubs. For example:
  • if the Charis font is not being displayed you should check the internal css for occurrences of font-family: something-or-other; and manually remove them.
  • if it's the massive line-height which isn't working, search the internal css for other occurrences of line-height: something-or-other; and manually remove them.

And another couple of comments whilst we're on the subject:
  • Your settings of margin-left: 1em; margin-right: 1em;
    I'm guessing you're trying to create page left/right margins. You might like to specify these in point-units (e.g. 5pt) rather than em-units. This is because em-units scale as you use the zoom button. Point-units will stay fixed no matter what you do with the zoom button.
  • Your setting margin-top: 1em
    I'm not sure what your aim is with this setting. It will just give you a top margin of 1em before the first paragraph only of each piece of the epub's html, which is usually a chapter. If your intention was to create some whitespace at the top of every page then you need to use an @page setting instead, e.g. @page {margin-top: 10pt} again using point-units rather than em-units. In fact you could use the @page for all your page borders if you wanted, i.e. change your Charis css code following all the @font-faces to something like (plug in whatever values you want)
    Code:
    @page {margin-top: 10pt; margin-bottom: 0; margin-left: 5pt; margin-right: 5pt}
    body, body.book, body.text, body.calibre, body.calibre1, body.calibre2, body.calibre3, body.calibre4 { 
    	font-family: serif;
    	text-align:justify;
    	font-size: 1em;
    	line-height: 3.2em;
    	margin-left: 0;
    	margin-right: 0;
    The above code should override any stupidly big margins in the original epub with your preferred values.
  • lastly, once you've got the Charis font and line-height displaying correctly, if the font-size isn't quite right for you, just adjust the font-size value from 1em to 0.95em or 1.05em (or whatever) until it's perfect.

Finally, please note that the latest version of PRS+ has introduced some extra options for adjusting font-size, page margins, line-height, etc directly from the Sony. But, IMHO, it does require a bit more experience with css style manipulation to get it to work satisfactorily.
jackie_w is offline   Reply With Quote
Old 02-21-2013, 09:13 PM   #5
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
Thanks so much, Jackie, I will try your suggestions. The CSS used is the same CSS I have been using during my Calibre conversions, and it is working fine there. Perhaps Calibre was also doing something else behind the scenes. The margin-top value seems to work just fine to put a margin at the top of each page, not the first paragraph of a chapter. My hope was that I wouldn't have to do Calibre conversions any more!

>>Finally, please note that the latest version of PRS+ has introduced some extra options for adjusting font-size, page margins, line-height, etc directly from the Sony. But, IMHO, it does require a bit more experience with css style manipulation to get it to work satisfactorily. <<

I just installed PRS+ a week ago, and I don't see these options. Where do I find them or is in the beta version? I installed the newest, non-beta version (as far as I know).

Thanks,
eP
elemenoP is offline   Reply With Quote
Advert
Old 02-21-2013, 09:14 PM   #6
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
And Mark, I do have my reader set to display the cover image, and you are right, it was just one particular title that was taking so long to shut down. Now that I am reading different books, there is no lag in shutdown.

eP
elemenoP is offline   Reply With Quote
Old 02-21-2013, 09:21 PM   #7
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
And also: what does this dialog box mean: "affects only books opened afterwards!" The book I'm currently reading isn't affected? How about if I open another book and then open the book I was reading again? Is it affected then? Or does the setting only affect books I've never opened (those with the "New" icon)?

Thanks,
eP
elemenoP is offline   Reply With Quote
Old 02-22-2013, 02:21 AM   #8
Mark Nord
2B || !2B
Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.Mark Nord can program the VCR without an owner's manual.
 
Posts: 851
Karma: 194010
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by elemenoP View Post
And also: what does this dialog box mean: "affects only books opened afterwards!" The book I'm currently reading isn't affected? How about if I open another book and then open the book I was reading again? Is it affected then? Or does the setting only affect books I've never opened (those with the "New" icon)?

Thanks,
eP
You are definitely not using the latest PRS+ which would be PRSP_650_2.1.02alpha.

You are, most certenly, using 2.0.18 which only applies custom CSS once, when a/the file is opened - not necessary a untouched new one, but it has to be opened from the file-system again.
So with 2.0.18 it is/was necessary to open another book, and change then back to the original one to see the CSS applied.

With 2.1.01a and 2.1.02a the epub-file will be reloaded by code. The CSS changes are applied immideately.

The extra-options - jackie mentioned - are included in the font-size-dialog, you get when you push the SIZE (Magnifier) Button.

For more info please see the WIKI on the project page. (Scroll down to Extended SizeOverlay for x50)

[EDIT] Just reread your post, and you mention there you installed the latest none alpha/beta code, which IS 2.0.18.
But IMHO it is well worth to try almost a full year of code-development which you find in 2.1.02a - even while alpha-state it is, most of the time, stable and safe to use
[/EDIT]

Last edited by Mark Nord; 02-22-2013 at 02:36 AM.
Mark Nord is offline   Reply With Quote
Old 02-22-2013, 08:59 AM   #9
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,208
Karma: 16534692
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by elemenoP View Post
The CSS used is the same CSS I have been using during my Calibre conversions, and it is working fine there. Perhaps Calibre was also doing something else behind the scenes.
Yes, the ExtraCSS code you type in is used by calibre to create new css in the output epub. The ExtraCSS isn't just copied as-is. That's why you need to add all those body.calibre, body.calibre1, ... etc to your PRS+ custom Charis.css.

Quote:
Originally Posted by elemenoP View Post
The margin-top value seems to work just fine to put a margin at the top of each page, not the first paragraph of a chapter.
I'm going to take an educated guess that the reason you are getting the page top margin you want is indeed due to your calibre conversion settings. But it is likely not your ExtraCSS which is creating it, but rather the settings you used on the Convert - PageSetup page. Any value, other than 'No margin', in the Margins: Top and Bottom boxes creates an @page {margin-top: value; margin-bottom: value} in the output epub css. These days it is stored in a second css file called page_styles.css. Before that it was stored in every single html file in the epub.

[Just for completeness I'll add, the Left/Right margins from the PageSetup page (if not set to 'No margin') are stored in the epub main css file, in whichever css class calibre has created for the <body> tag.]

Quote:
Originally Posted by elemenoP View Post
My hope was that I wouldn't have to do Calibre conversions any more!
It's possible that you may not need to convert all future epubs, but be aware that non-calibre-converted epubs use more than one method to produce their intended page margins:
  • Left/Right can be in an @page{...} statement, in the body class or in the Adobe-specific file page-template.xpgt.
  • Top/Bottom can be in an @page{...} statement or in the Adobe-specific file page-template.xpgt.
some retail epubs may even use all of them and the margins are additive so you get the 'landing strip' or the 'postage stamp' look! The setting I outlined in the second-half of my earlier post attempt to override the various possible page margins which may already be in the epub (calibre-converted or other) and replace them with your chosen settings as per the @page in Charis.css. Unfortunately, there's nothing you can do in PRS+ to override the aggravating (IMO) page-template.xpgt file, so my personal choice is to always remove this immediately from any new epub (needs to be non-DRM) using the calibre 'Modify Epub' plugin. I believe a calibre epub-epub conversion will also remove it, but since you're trying to avoid that...
jackie_w is offline   Reply With Quote
Old 02-23-2013, 09:42 AM   #10
elemenoP
Wizard
elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.elemenoP ought to be getting tired of karma fortunes by now.
 
Posts: 1,717
Karma: 3790058
Join Date: Oct 2010
Location: NYC
Device: Kindle Paperwhite, Sony 650
Thank you, Mark, I will definitely check out the newest version. I was a bit nervous to flash the reader, so I chose what I thought would be the most stable.

Jackie: You are right, I did have values in "Page Setup" in Calibre! I didn't even remember that. I will play around with all of this when I have the time. Thank you so much for all of your help!

eP
elemenoP is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Price Custom Column Formatting Help PaulineDesigns Library Management 13 07-22-2022 09:23 PM
Publisher Default Formatting and Custom Fonts Stiggosaurus Sigil 1 01-22-2013 04:56 AM
Inconsistent Spacing N00ter ePub 26 04-15-2012 09:51 AM
Formatting Floating Point # Custom Column GeekyGal Library Management 3 06-03-2011 05:34 PM
Inconsistent Metadata windybt Calibre 8 10-10-2010 12:31 PM


All times are GMT -4. The time now is 06:40 PM.


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