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-16-2012, 04:43 AM   #16
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
Assuming I am not unique, my two reasons for avoiding rooting so far are:
  • Lack of previous experience in the 'app world'. I don't have a smart phone or a tablet so confidence in using a new environment is low.
  • Although I can see that it can be fun to push the boundaries with a new toy, I have not seen a 'killer' reading app which makes it worth the risk of stepping out of the comfort zone. Now if someone were to offer the Sony PRSPlus bells & whistles as an app, I'd root in a flash (no pun intended ).

Good luck! I don't know whether you already read one of the other threads, but if you manually add a statement (credit to snarkophilus)
Code:
@import url(res:///ebook/fonts/../../mnt/sdcard/css/my.css);
to the top of the css file in an epub then the T1 will use everything in the int.mem user-accessible file [intmem:]/css/my.css (which can contain all the @font-faces and any other custom css) when displaying the epub. If you get the contents of your custom css file correct it won't interfere with the standard (or your fixed) select-a-font feature. The drawback is that, so far, the only way to edit each epub is manually. If this @import could be part of the Sony reader app generated css, this may be a way forward. Then all that is needed is another app on the T1 which will display a list of css files in directory [intmem:]/css and when one is selected copy it to /css/my.css -- instant custom font change. It does work, I've been using it. It's a bit like the way the PRSPlus custom firmware works on the earlier Sonys.
Alright, in that case i guess a package that just replaces the reader application (or installs another besides the original, but without the rest of the root) might be a good thing. I'll make a package and do some testing to make sure it doesn't break anything

Yes, I've seen that it's possible to access fonts outside the internal fonts folder. What I'm working on is intercepting the calls to the methods that generate the CSS and the font selector and replacing the fonts with ones specified in a settings file on the internal storage. I'm about half-way there.

Quote:
Originally Posted by Rand Brittain View Post
So, seriously? This fixes the reader italics bug?

More importantly YOU FIXED THE GODDAMN BUG BY CHANGING TWO LINES OF CODE AND SONY HASN'T FIXED IT THEMSELVES YET???!???one!?

EDIT: Also I fear it crashed shortly after I started fiddling with it, so it might not be there quite yet.
It was more like 24 lines of smali assembly, to be honest, but they look like they were generated from one or two lines of Java. I guess maybe they never realized small-caps was causing trouble?

I've never been able to make it crash, I'm afraid. Does it happen every time, or when you do something in particular? If possible, it would be great if you could post the log around the time of the crash (`adb logcat` if you have adb installed and configured, or `logcat > /mnt/sdcard/log.txt` in a terminal on the device).
Morkl is offline   Reply With Quote
Old 01-16-2012, 12:17 PM   #17
Rand Brittain
Bookmaker
Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 2143650
Join Date: Sep 2010
Device: Cybook Opus
It seems to crash every time I try to open the Settings menu (menu button -> More -> Setings) from within the Reader app.
Rand Brittain is offline   Reply With Quote
Old 01-16-2012, 01:04 PM   #18
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 Rand Brittain View Post
It seems to crash every time I try to open the Settings menu (menu button -> More -> Setings) from within the Reader app.
Confirmed, thanks. Seems like the Reader app isn't as lenient as the home screen when it comes to living in a separate package from the rest of the Sony apps (i.e. being installed next to the original Reader). I'll post a package that replaces the original reader as soon as I know it doesn't cause any catastrophic failures
Morkl is offline   Reply With Quote
Old 01-16-2012, 05:26 PM   #19
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
Wow, my initial guess as to what was the problem was off by miles and now I've been trying to make a working packaged that replaced the original reader for hours, to no avail. Beh.

Anyway, here is a new package, in which Menu->More->Settings works:
http://morkl.se/reader/readermod_v1.1.zip
And here is one that doesn't requires root, but just installs it as a regular app and removes the default app preferences (basically the same as a root package but with the modified Reader app instead of the system utilities and launchers and superuser thingamajigs and whatnot):
http://morkl.se/reader/readermod_v1.1_noroot.zip (install by connecting reader to PC, enter Data Transfer Mode, then doubleclick flash_reader.bat)

N.B. these do not replace the original Reader, as i anticipated in my previous post. Doing so seems to be a lot more tricky than I thought, since it would the require a bunch of other system apps to be replaced as well.

Coming up next: The progress I made during my lunch break today
Morkl is offline   Reply With Quote
Old 01-16-2012, 06:46 PM   #20
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
...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)
Attached Thumbnails
Click image for larger version

Name:	20120117_001143.jpg
Views:	1025
Size:	492.4 KB
ID:	81430   Click image for larger version

Name:	20120117_001152.jpg
Views:	1132
Size:	525.1 KB
ID:	81431   Click image for larger version

Name:	20120117_001219.jpg
Views:	871
Size:	489.2 KB
ID:	81432  
Morkl is offline   Reply With Quote
Old 01-16-2012, 06:59 PM   #21
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
Wonderful!!!!!!! One quick question: Is there any way to change the "Original" font setting as well? Or is it simply impossible to do so?
soseono is offline   Reply With Quote
Old 01-16-2012, 07:13 PM   #22
quisvir
Addict
quisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animalsquisvir is kind to children and small, furry animals
 
quisvir's Avatar
 
Posts: 238
Karma: 6875
Join Date: Feb 2009
Location: Netherlands
Device: Kindle PW2
Great work once again Morkl! Next step... selecting custom css?
quisvir is offline   Reply With Quote
Old 01-16-2012, 07:38 PM   #23
Rand Brittain
Bookmaker
Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.Rand Brittain ought to be getting tired of karma fortunes by now.
 
Posts: 416
Karma: 2143650
Join Date: Sep 2010
Device: Cybook Opus
That is truly inspired coding. You have taken the PRS-T1 from "not a good choice because of disqualifying software bugs" to "quite a good choice."

It is sad that Sony couldn't do that on their own, since it took you about a day, but you, you get the right to be happy.
Rand Brittain is offline   Reply With Quote
Old 01-16-2012, 08:24 PM   #24
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,196
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@Morkl,

Wow, such rapid progress!!! Thank you

Now, please don't take this the wrong way. For us clueless non-Android types, if we have any problems after installing the customised reading app, is there a way to get back to standard Sony firmware?

Edit: I decided to risk it, anyway. Tried to run from the install_noroot folder (I'm using a WinXP PC). The messages coming up in the CMD box appeared to be copying the files to the T1, however it doesn't seem to have completed the process.
The script.log file contains the following:
Code:
Starting ./update.sh
./updates/data/app/EbookReaderMod.apk: MD5 check failure [ != 8c740786ff94bc488b623b68b3fef788]
clean_exit
I tried a second time, but unfortunately with exactly the same result. Any suggestions?

This is the content of the checksums file. By any chance, is the problem simply that the name in there is EbookReaderMod.apk when it should be EbookReader.apk?
Code:
8c740786ff94bc488b623b68b3fef788  ./updates/data/app/EbookReaderMod.apk
f078951460edbc1b7d7f4f06aa63dac4  ./tmp/do_update.sh
2e8f803dbd819b2b999b2e34539b84ce  ./tmp/rescue.updater

Last edited by jackie_w; 01-16-2012 at 09:59 PM.
jackie_w is offline   Reply With Quote
Old 01-17-2012, 05:15 AM   #25
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
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 font is a special case; the device doesn't generate any CSS for it (instead using the renderer's default CSS). It might be possible to circumvent the check though.

Quote:
Originally Posted by quisvir View Post
Great work once again Morkl! Next step... selecting custom css?
That is definitely what's next for the Reader app. I'm gonna take a small break and clean up my code first though

Quote:
Originally Posted by Rand Brittain View Post
That is truly inspired coding. You have taken the PRS-T1 from "not a good choice because of disqualifying software bugs" to "quite a good choice."

It is sad that Sony couldn't do that on their own, since it took you about a day, but you, you get the right to be happy.
That's the thing I like about open (or in this case closed but rootable) systems, where anyone with the know-how and time to spare can fix things. Now, if only Sony would put up a repository where I could post my patches...

Quote:
Originally Posted by jackie_w View Post
@Morkl,

Wow, such rapid progress!!! Thank you

Now, please don't take this the wrong way. For us clueless non-Android types, if we have any problems after installing the customised reading app, is there a way to get back to standard Sony firmware?

Edit: I decided to risk it, anyway. Tried to run from the install_noroot folder (I'm using a WinXP PC). The messages coming up in the CMD box appeared to be copying the files to the T1, however it doesn't seem to have completed the process.
The script.log file contains the following:
Code:
Starting ./update.sh
./updates/data/app/EbookReaderMod.apk: MD5 check failure [ != 8c740786ff94bc488b623b68b3fef788]
clean_exit
I tried a second time, but unfortunately with exactly the same result. Any suggestions?

This is the content of the checksums file. By any chance, is the problem simply that the name in there is EbookReaderMod.apk when it should be EbookReader.apk?
Code:
8c740786ff94bc488b623b68b3fef788  ./updates/data/app/EbookReaderMod.apk
f078951460edbc1b7d7f4f06aa63dac4  ./tmp/do_update.sh
2e8f803dbd819b2b999b2e34539b84ce  ./tmp/rescue.updater
Yes, there is a "restore" package that flashes back the original firmware and an "sd rescue" package which does the same from a memory card even when unable to connect the device to a PC.

And the problem: my bad. I forgot to change the name of the file. Either change EbookReaderMod.apk to EbookReader.apk in the checksums file or rename the file EbookReader.apk to EbookReaderMod.apk or redownload readermod_v2.zip, because I have fixed it now
Morkl is offline   Reply With Quote
Old 01-17-2012, 06:52 AM   #26
vishcompany
Addict
vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.vishcompany can fool all of the people all of the time.
 
vishcompany's Avatar
 
Posts: 283
Karma: 138550
Join Date: Mar 2009
Device: Gen3(†); PB302(↓); PRS-350; T1; voyage
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)
Many thanks also from my side! Unbelieveable, how fast this is developping.
Really looking forward to the version with custom css á la PRS+.
vishcompany is offline   Reply With Quote
Old 01-17-2012, 08:46 AM   #27
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,196
Karma: 16228558
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
@Morkl,

This seems to be working OK now A couple of (probably dumb) questions, please.

Firstly, after the update I have some new files in int.mem
  1. dir - /updates
  2. file - PRS-T1 Updater.package
  3. file - script.log
I'm assuming item 3 can be deleted. Are items 1 and 2 now part of the firmware or are they temp files which can also be deleted?

Secondly, when I open a book I now get the choice to select either the new modified reader app or the original Sony app. If I chose the option to set the new app as default, would I be able to reverse the decision afterwards or would I need to use the restore package then reinstall the mod to get the either/or choice back?

Once again, many thanks for your efforts, karma heading your way
jackie_w is offline   Reply With Quote
Old 01-17-2012, 08:56 AM   #28
rupor
meat popsicle
rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!rupor rocks like Gibraltar!
 
rupor's Avatar
 
Posts: 225
Karma: 100000
Join Date: Jul 2007
Location: USA
Device: Kindles, Pixels, iPads
Morkl

Any chance on supporting hyphenation? Nook does (rumor says they are using different version of Adobe SDK)? Worth checking?
rupor is offline   Reply With Quote
Old 01-17-2012, 10:18 AM   #29
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,

This seems to be working OK now A couple of (probably dumb) questions, please.

Firstly, after the update I have some new files in int.mem
  1. dir - /updates
  2. file - PRS-T1 Updater.package
  3. file - script.log
I'm assuming item 3 can be deleted. Are items 1 and 2 now part of the firmware or are they temp files which can also be deleted?

Secondly, when I open a book I now get the choice to select either the new modified reader app or the original Sony app. If I chose the option to set the new app as default, would I be able to reverse the decision afterwards or would I need to use the restore package then reinstall the mod to get the either/or choice back?

Once again, many thanks for your efforts, karma heading your way
They can all be deleted; the only new stuff that is needed is the fonts folder, and it should only be needed when using custom fonts.

Quote:
Originally Posted by rupor View Post
Morkl

Any chance on supporting hyphenation? Nook does (rumor says they are using different version of Adobe SDK)? Worth checking?
I was just thinking of that last night. I fear it may be rooted deep withing native libraries, but it is definitely worth looking into.
Morkl is offline   Reply With Quote
Old 01-17-2012, 11:02 AM   #30
treadlightly
Wizard
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: 1,370
Karma: 6957792
Join Date: Nov 2010
Location: Ottawa, ON
Device: Kobo H2O
Thank you! I tried this out and it worked very well! If we're adding to the wish list, I'd like to vote for justification
treadlightly is offline   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 06:04 AM.


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