Custom Font Hack

WARNING: this is an outdated version of the hack. Please go to this page of the blog for the current version.
 
Warnings:
  • this procedure could only be used when your Nook firmware version is the original 1.5.0 by B&N or any derived firmware (like softroot firmware 2.5.1); applying this procedure when your firmware (you can check your firmware version on Settings page of your Nook) is a different one, will probably lead to your reader not working anymore; 
  • applying this procedure you will void your warranty and you may even brick your Nook; i don't take any responsibility in the (unlikely) event something goes wrong while executing the below mentioned procedure;
  • i received some feedback from user that applying the following procedure could require re-registering Nook in case it was already registered; is it also possible that it will be necessary to re-download purchased books from B&N. Please be sure this is not a problem in your case.
  1. verify you have root access to your Nook; a short tutorial on how to get it here;
  2. download the font hack files:
    • current version:
      • fontHack_1.2.7z (17/12/2010, sha1: d23c014cd486f861ea646fb42b0860470ff3da20)
    • changelog:
      • 1.2 - fixed a bug of current font sometimes not correctly displayed in setting menu; in case file .fontname is missing, "unknown font X" is used as font name;
      • 1.1 - fixed a bug of ignored font definition in folder "font1";
      • 1.0 - intial version;
    • previous versions (do not use them; just for reference):
      • fontHack_1.1.7z (06/12/2010, sha1: e75fc3edebaad89aa0c8fb0123fa799972226930)
      • fontHack_1.0.7z (04/12/2010, sha1: 187cde1c26d09d3c2d00c1cb9386b811af3d27f8)
  3. create a folder on you PC (let's call it C:\fontHackFolder), and then unpack the downloaded file on that folder;
  4. connect to your Nook through ADB (either over USB or Wi-Fi); if you don't know what this means, you can find more details here;
  5. make a backup of files on Nook we are going to modify (in case you want to rollback the font-related modification):
    adb pull /system/app/ReaderEpub.apk C:\fontHackFolder\original\
    adb pull /system/lib/libpdfhost.so C:\fontHackFolder\original\
    
  6. copy files downloaded in step 1. on Nook:
    adb push C:\fontHackFolder\ReaderEpub.apk /system/app
    adb push C:\fontHackFolder\libpdfhost.so /system/lib
    
  7. On internal Nook sd-card (i.e. the one that by default is called "Nook" in Windows explorer, and that contains folders "my documents", "my screensavers", "my wallpapers"), create folder "my fonts" (lowercase);
  8. inside folder "my fonts", create 3 sub-folders: font1, font2 and font3; you should now see, when Nook is attached to a PC through USB cable, something like this;
  9. reboot your Nook.
  10. Now, you can use whatever fonts you like (that will replace one of the 3 default fonts) by putting the following 5 files into the 3 above mentioned folder font1 (to replace Amasis), font2 (to replace Helvetica Neue) and font3 (to replace Light Classic):
    • normal.ttf: for plain text;
    • bold.ttf: for bold text;
    • italic.ttf: for italic text;
    • bold_italic.ttf: for bold and italic text;
    • <name of the font>.fontname : this is an empty file, <name of the font> string is displayed in font change menu of ePub Reader application of Nook (in case this file is missing, the label "unknown font X" is used, being X equal respectively 1,2 or 3).
Some remarks:
  • the modification introduced on libpdfhost.so toward the original one included in original firmware 1.5.0 by B&N is just on the CSS code used to manage font families, that for some reason i don't understand it is hardcoded into .so file, on this firmware version (instead that on APK file); just to be clear: i didn't replaced the .so file with the version used in previous firmware;
  • use always lowercase file name (except for <name of the font>, where you can use whatever you want);
  • use always ttf extension, even for otf fonts (that are also supported by Nook);
  • apparently, some fonts are not supported by reader applications, for some unknown reasons; in that case, they are just ignored and the default font is instead used (i.e. Light Classic);
  • in case the font files are missing on any fontX folder (or the entire folder fontX is missing), the corresponding default font is used.
If you want, you can download here (sha1: 891bdf73cab87a17f4b2beb3a226c7b9d0aea9a4) a sample "my fonts" folder structure. In this example, font1 folder contains "Gentium" font; font2 and font 3 are empty so the default fonts "Helvetica Neue" and "Light Classic" are used.


As a bonus feature, the modified ReaderEpub also fixes an annoying bug (at least, for me this is a bug!) introduced in Reader application of firmware 1.5.0, i.e. the fact that the chapter list of Go-To menu just considers the first-level items of the table of content. With this modified version, the chapter list will consider all items up to level 3 (i.e. the same behaviour of Reader app of firmware 1.4.x).







Annex - short tutorial on gaining root access on Nook


To apply font hack, the first step is to gain root access to your Nook. This means that you will be able to get access to Nook operating system, and perform some low-level operations like: installing or updating system applications (in our case, ePub reader application); editing system files.
Rooting the Nook normally is not particularly difficult, but may require some technical capabilities. In any case, you can find all information you may need and all required files on web site of Nook user community Nookdevs.
In particular, you may be interested in so-called Softroot procedure. Warning: the Nookdevs site was not updated after launch of firmware update 1.5.0 by B&N; but the Softroot version of 1.5.0 is already available, thanks to user Perfinion, on his web server (file: bravo_update-2.5.1.dat; sha1: 438d387126530e08de896bb4a4a25e2f2725f430). So you may follow all instruction contained in Nookdevs site (caveat: pay attention to new hardware revision instructions), but use latest version of softroot firmware instead of the one provided in Nookdevs page. Hopefully, the Nookdevs website will be soon updated and therefore this warning could be removed.
I want to mention that Nookdevs softroot it's not the only way to gain root access. Other users/teams work on Nook to provide improved features and additional applications; amongst them, the root access is provided for instance by:


A detailed description on how the modification is made and how could be further personalized in a next post..

    No comments:

    Post a Comment