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 01-17-2012, 01:17 PM   #31
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,666
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by soseono View Post
Wonderful!!!!!!! One quick question: Is there any way to change the "Original" font setting as well? Or is it simply impossible to do so?
Original is one setting I would leave alone. It means how the books looks without changing things. Some books such as 11/22/63 have embedded fonts that should be there for the best looking read.
JSWolf is offline   Reply With Quote
Old 01-17-2012, 01:30 PM   #32
soseono
Connoisseur
soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.
 
soseono's Avatar
 
Posts: 62
Karma: 36180
Join Date: Dec 2011
Location: US East Coast
Device: Kobo Aura HD, Kindle 4, Sony PRS-T1 (formerly PRS-500 & 505), iPad Air
Quote:
Originally Posted by JSWolf View Post
Original is one setting I would leave alone. It means how the books looks without changing things. Some books such as 11/22/63 have embedded fonts that should be there for the best looking read.
Do you mean that changing the Original font mapping will invalidate embedded fonts in ebook files? If then, I agree that it's better left alone.

I wish in the Sony internal Settings, there is a default font choice setting as well as the (current) default font size setting.
soseono is offline   Reply With Quote
Old 01-17-2012, 04:31 PM   #33
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,666
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by soseono View Post
Do you mean that changing the Original font mapping will invalidate embedded fonts in ebook files? If then, I agree that it's better left alone.

I wish in the Sony internal Settings, there is a default font choice setting as well as the (current) default font size setting.
There is a default font size setting someplace in the options.

Yes, changing original will change the original look of the ePub. It may not invalidate embedded fonts. It depends on how they are set in the CSS.
JSWolf is offline   Reply With Quote
Old 01-17-2012, 04:35 PM   #34
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,666
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Morkl View Post
...and here it is! Stock Reader with custom fonts in the select-a-font-thingy (and the italic/bold-fix, of course).

Fonts are specified in /sdcard/fonts/fonts.xml, and if that file is not found or cannot be read it falls back to the stock fonts.

"Screenshots" attached, with exaggerated fonts to make it clear that it works (the reason "Bold italicized text" is not italicized in one of the images is that I had no bold-italic file for that font, so i set the bold file as bold-italic).

As you can see, the "Selected Font Type" thingy does not show the custom font name for now; it consists of a bunch of hard coded button resources and so requires a bit of extra work to replace.

File: http://morkl.se/reader/readermod_v2.zip (contains loose apk as well as installer for non-rooted devices; and fonts folder with sample settings)
This new mod works quite well overall. I did find one bug. When using the fonts.xml file to add/change what fonts are available via Sony's menu, after I select one of my installed fonts, the name displayed as to what font it is is a different name. The last font in the list gave me a title of Verdana.
JSWolf is offline   Reply With Quote
Old 01-17-2012, 05:37 PM   #35
snarkophilus
Wannabe Connoisseur
snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.snarkophilus ought to be getting tired of karma fortunes by now.
 
Posts: 241
Karma: 1009530
Join Date: Apr 2011
Location: Geelong, Australia
Device: Sony PRS-T1, Sony PRS-350, Palm TX
Morkl - great work! I installed this last night but didn't have a chance to play with it until my train ride this morning. I've also installed your homescreen mod, and that in combination with the reader mod works really well. I'll echo the comments of others here about what a great job you've done in a short amount of time. Some extra karma coming your way.

Now, I'm eagerly awaiting the user css next .

Could this be done as simply as replacing one of the existing font-face directives in the smali code? For example, replace

@font-face{ font-family: %s; font-style:normal; font-weight:normal; src: url(%s);}

with

@font-face{ font-family: %s; font-style:normal; font-weight:normal; src: url(%s);}
@import url(res:///ebook/fonts/../../mnt/sdcard/css/my.css);

I've previously determined that referencing a CSS that doesn't exist doesn't cause problems. If that works, then (hopefully!) it can be made an option but this (should!) be a simple way of verifying that it's that simple to deal with.

Quote:
Originally Posted by JSWolf View Post
This new mod works quite well overall. I did find one bug. When using the fonts.xml file to add/change what fonts are available via Sony's menu, after I select one of my installed fonts, the name displayed as to what font it is is a different name. The last font in the list gave me a title of Verdana.
I noticed this too this morning. That looks like the list in the "selected font" box is using the original hard-coded Sony list. Hopefully it's as simple as Morkl overriding the Sony font list in one more place.

Cheers,
Simon.
snarkophilus is offline   Reply With Quote
Old 01-17-2012, 05:39 PM   #36
Morkl
Connoisseur
Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.
 
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
Quote:
Originally Posted by soseono View Post
Do you mean that changing the Original font mapping will invalidate embedded fonts in ebook files? If then, I agree that it's better left alone.

I wish in the Sony internal Settings, there is a default font choice setting as well as the (current) default font size setting.
Quote:
Originally Posted by JSWolf View Post
There is a default font size setting someplace in the options.

Yes, changing original will change the original look of the ePub. It may not invalidate embedded fonts. It depends on how they are set in the CSS.
When changing font, the "serif" and "sans-serif" font-families are overridden, so any text that uses one of those (i.e. hasn't specified an explicit font-family) is rendered in the selected font.

However, as far as I know, if a book has its own @font-face declarations, they override any ones (of the same font-family) previously generated by the reader (which is why fonts with @font-face declarations look the same no matter what font is chosen in the select-a-font)? If the embedded fonts as declared as font-family="not serif or sans-serif" they won't be affected by the select-a-font.

Quote:
Originally Posted by JSWolf View Post
This new mod works quite well overall. I did find one bug. When using the fonts.xml file to add/change what fonts are available via Sony's menu, after I select one of my installed fonts, the name displayed as to what font it is is a different name. The last font in the list gave me a title of Verdana.
Do you mean above the font sizes, like shown here? That's what I meant with
Quote:
Originally Posted by morkl
As you can see, the "Selected Font Type" thingy does not show the custom font name for now; it consists of a bunch of hard coded button resources and so requires a bit of extra work to replace.
I'm well aware of it and I will fix it in a not too distant future I hope
Morkl is offline   Reply With Quote
Old 01-17-2012, 05:42 PM   #37
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 37,666
Karma: 18475502
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by Morkl View Post
Do you mean above the font sizes, like shown here? That's what I meant with
Yes, the name of the font above the font size selections. Where your photo shows Univers Next.

Quote:
I'm well aware of it and I will fix it in a not too distant future I hope
That would be nice but if not, it's not really a big deal to live with.
JSWolf is offline   Reply With Quote
Old 01-17-2012, 07:29 PM   #38
jackie_w
Wizard
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: 2,833
Karma: 4199513
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by snarkophilus View Post
Code:
@font-face{ font-family: %s; font-style:normal; font-weight:normal; src: url(%s);}
@import url(res:///ebook/fonts/../../mnt/sdcard/css/my.css);
@Morkl,

Just a FYI. If you do plan on using @import to provide the custom CSS feature then I believe it needs to be the first thing in any internally generated CSS file, i.e. all @import rules come before any @font-face rules.
jackie_w is online now   Reply With Quote
Old 01-17-2012, 07:42 PM   #39
Morkl
Connoisseur
Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.
 
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
Quote:
Originally Posted by snarkophilus View Post
Morkl - great work! I installed this last night but didn't have a chance to play with it until my train ride this morning. I've also installed your homescreen mod, and that in combination with the reader mod works really well. I'll echo the comments of others here about what a great job you've done in a short amount of time. Some extra karma coming your way.

Now, I'm eagerly awaiting the user css next .

Could this be done as simply as replacing one of the existing font-face directives in the smali code? For example, replace

@font-face{ font-family: %s; font-style:normal; font-weight:normal; src: url(%s);}

with

@font-face{ font-family: %s; font-style:normal; font-weight:normal; src: url(%s);}
@import url(res:///ebook/fonts/../../mnt/sdcard/css/my.css);

I've previously determined that referencing a CSS that doesn't exist doesn't cause problems. If that works, then (hopefully!) it can be made an option but this (should!) be a simple way of verifying that it's that simple to deal with.



I noticed this too this morning. That looks like the list in the "selected font" box is using the original hard-coded Sony list. Hopefully it's as simple as Morkl overriding the Sony font list in one more place.

Cheers,
Simon.
Never realized the PRS-T1 handles @import statements. That made the custom CSS a whole lot simpler.

New version posted here (just uploaded it; should be available soon). Loose apk and installer for non-rooted devices included.

It just prepends "@import url(res:///ebook/fonts/../../mnt/sdcard/css/style.css);" to the CSS (i.e. /mnt/sdcard/css/style.css is loaded if it is there).

Would a setting for the file name be useful? I'm thinking, if you're able to modify the settings you're probably able to rename the file just as well, no?
Morkl is offline   Reply With Quote
Old 01-17-2012, 07:47 PM   #40
Morkl
Connoisseur
Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.Morkl can talk to the animals.
 
Posts: 80
Karma: 68347
Join Date: Oct 2009
Location: Sweden
Device: PRS-T1
Quote:
Originally Posted by jackie_w View Post
@Morkl,

Just a FYI. If you do plan on using @import to provide the custom CSS feature then I believe it needs to be the first thing in any internally generated CSS file, i.e. all @import rules come before any @font-face rules.
I found that out the hard way about an hour ago

Interestingly, since the custom CSS is loaded before the @font-face declarations, one can put @font-face declarations for font-family "serif" and "sans-serif" in the custom CSS to replace the original font, since they are overridden by the generated declarations for any non-original font.
Morkl is offline   Reply With Quote
Old 01-17-2012, 08:22 PM   #41
jackie_w
Wizard
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: 2,833
Karma: 4199513
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by Morkl View Post
Would a setting for the file name be useful? I'm thinking, if you're able to modify the settings you're probably able to rename the file just as well, no?
What would be very useful is an on-device app which lists all your custom .css files contained in the /mnt/sdcard/css directory and lets you pick a new default when you want to change fonts or font-sizes or whatever else.

Not having to connect to the PC to make the change would be very convenient. It could be as simple as just copying the selected .css file to the fixed filename style.css in the same directory. Then your modded reader app would work as-is. This is how the PRSPlus custom firmware for the older Sony models handles this feature.
jackie_w is online now   Reply With Quote
Old 01-19-2012, 12:20 AM   #42
soseono
Connoisseur
soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.soseono can successfully navigate the Paris bus system.
 
soseono's Avatar
 
Posts: 62
Karma: 36180
Join Date: Dec 2011
Location: US East Coast
Device: Kobo Aura HD, Kindle 4, Sony PRS-T1 (formerly PRS-500 & 505), iPad Air
Morkl,

Again thanks much for the good work. By the way, I'm using the latest version, and found that the font size setting doesn't follow the global setting value (System Settings -> Application Preferences -> Books/Periodicals -> Font Size Preference). I've set the system setting value to a larger font size (the third smallest), but the font size of all the new books that I open with your modded reader app is the system's initial default value, which is the second smallest.

FYI, just in case you weren't aware of this issue.

Last edited by soseono; 01-19-2012 at 03:51 AM.
soseono is offline   Reply With Quote
Old 01-19-2012, 11:17 AM   #43
treadlightly
Guru
treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.
 
treadlightly's Avatar
 
Posts: 997
Karma: 3848772
Join Date: Nov 2010
Location: Ottawa, ON
Device: Kobo Glo. H2O
Can margins, alignment or line spacing be set in style.css? I tried

html { text-align: justify; }

but perhaps I have the wrong syntax.
treadlightly is online now   Reply With Quote
Old 01-19-2012, 11:51 AM   #44
jackie_w
Wizard
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: 2,833
Karma: 4199513
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
Quote:
Originally Posted by treadlightly View Post
Can margins, alignment or line spacing be set in style.css? I tried

html { text-align: justify; }

but perhaps I have the wrong syntax.
There's no reason why you can't set those properties. I set line-height and font-size in mine.

If it's not working for a particular epub it's probably because some of the css inside the epub is more specific and is overriding your top level setting. This is particularly likely if you created your epub using Calibre, depending on the conversion settings you used.

You can try and add more to your style.css to combat the epub's own css. If you are a Calibre user you could try something like
Code:
body, body.calibre, body.calibre1, body.calibre2, body.calibre3
    {text-align: justify; 
      line-height: ???; 
      margin-left: ???; 
      margin-right: ???}
filling in the ??? with whatever values you want.

If that still doesn't work, you could try changing the first line to
Code:
body, body.calibre, body.calibre1, body.calibre2, body.calibre3, div, p
If it still doesn't work (and it's a non-DRM'd epub) it's likely that you would need examine the epub css and manually remove the text-align, line-height, margin settings which are stopping your style.css working.

I'm afraid, with epubs there's no "automatic magic solution" which works 100% of the time.

An alternative option is to use one of the other epub reading apps (FBReader, CoolReader) rather than the Sony reader or Morkl's much improved modified version. You would need to root your T1 to do that. Those apps ignore most (all???) the css inside the epub and let you define your own settings. This is why many people like these apps. The problem is that you may not want ALL the epub css to be ignored if it's a well-formatted epub. In this case the Sony app is better option, especially with Morkl's changes. You just have to decide which approach you prefer.

Last edited by jackie_w; 01-19-2012 at 12:09 PM. Reason: alt option
jackie_w is online now   Reply With Quote
Old 01-19-2012, 01:47 PM   #45
treadlightly
Guru
treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.treadlightly ought to be getting tired of karma fortunes by now.
 
treadlightly's Avatar
 
Posts: 997
Karma: 3848772
Join Date: Nov 2010
Location: Ottawa, ON
Device: Kobo Glo. H2O
Thanks jackie_w, it worked!
treadlightly is online now   Reply With Quote
Reply

Tags
css, fonts

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-350 Changing Fonts in PRS+ spacebrew Sony Reader Dev Corner 31 08-24-2012 06:29 AM
PRS-350 PRS 350 & PRS+: Changing LRF-fonts permanently Analogus Sony Reader Dev Corner 21 11-08-2011 11:55 AM
Am i doing it right?PRS+ and CSS forced Epub fonts via Calibre melkorbauglir Sony Reader 20 07-29-2011 10:09 AM
How does the fonts of PRS-350 and PRS-650 compare to each other? lkkmaths Sony Reader 16 04-08-2011 07:43 PM
Changing text size and fonts with PRS 505 levi_john Sony Reader 1 01-20-2009 03:25 AM


All times are GMT -4. The time now is 02:56 PM.


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