03-07-2015, 05:14 PM | #1 |
Enthusiast
Posts: 37
Karma: 160968
Join Date: Sep 2010
Location: Germany
Device: PRS-500-505-700, Kindle3, KT, KPW, KPW2, KV, KOA
|
Edit jars on 5.6.1.0.5 (margins, font sizes) -- and non-jb fonthack
I was editing, monkey style (i.e. without putting any effort into understanding), the jars in version 5.6.1.0.5 for a Kindle Voyage, to get the margins, font sizes, etc. right.
The margins editing is ok, small changes, but it seems to work fine, same with the progress bar size (ReaderSDK-impl-en_GB.jar). Instead of fixed values, now the numbers are used to multiply the pixVal value, which for KV is 0.4245. Apparently the mobi and PDF readers still have the same resource names, so it should work as well. The problem is with the kf8 resources (HTMLReader-impl-en_GB.jar) which are now changed and the htmlreader.font.size.list* constants are missing from the resources. Maybe the new sw version uses the same parameters for kf8 as for mobi, I've got no clue. Before I start spending lots of time to actually be able to understand what has to be edited, I though I might get lucky and some good soul on this list has already identified the resources to edit to get the font sizes right ... anybody? |
03-07-2015, 06:42 PM | #2 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Nope, mostly noticed the same kind of stuff (except way more by chance than any real skill ^^) when I looked at it on a PW2. That, and I can already barely even *read* Java, so, Java asm, ahahahahahahahahah. Errm.
Ping @kaznelson? . Last edited by NiLuJe; 03-07-2015 at 06:45 PM. |
Advert | |
|
03-08-2015, 03:57 PM | #3 |
Enthusiast
Posts: 37
Karma: 160968
Join Date: Sep 2010
Location: Germany
Device: PRS-500-505-700, Kindle3, KT, KPW, KPW2, KV, KOA
|
Amazing! Amazon plays fair, see below:
Code:
public float[] Sy() { J b; float[] a = b.YTD("/mnt/us/FONT_RAMP"); if (a != null && a.length > 0) { return a; } return (float[])ResourceBundle.getBundle("com.amazon.ebook.booklet.reader.resources.ReaderResources").getObject("font.size.mapping"); } public float[] zy() { J b; float[] a = b.YTD("/mnt/us/CJK_FONT_RAMP"); if (a != null && a.length > 0) { return a; } return (float[])ResourceBundle.getBundle("com.amazon.ebook.booklet.reader.resources.ReaderResources").getObject("font.size.mapping.cjk"); } [root@kindle log]# cat /mnt/us/FONT_RAMP 7.49 8.43 9.37 10.31 11.25 12.19 13.13 14.07 It works perfectly, although the size of the characters in the font menu (where one taps to select the size) do not change, they stay the same. A framework or device restart is required after creating the files. I did not check yet if this works for non-kf8 books. Last edited by eschwartz; 03-08-2015 at 04:12 PM. Reason: Those code tags are useful ;) |
03-08-2015, 04:15 PM | #4 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
+1 karma for the great discovery!
Does this appear on any other firmware revisions? |
03-08-2015, 04:30 PM | #5 |
Enthusiast
Posts: 37
Karma: 160968
Join Date: Sep 2010
Location: Germany
Device: PRS-500-505-700, Kindle3, KT, KPW, KPW2, KV, KOA
|
Apparently it does not work on 5.4.3.2. I have also checked mobi books, it does not work, but one can patch Mobi-drawing-en_GB.jar to control font sizes for mobi.
Last edited by ecostin; 03-08-2015 at 04:32 PM. |
Advert | |
|
03-09-2015, 11:07 AM | #6 |
Junior Member
Posts: 1
Karma: 10
Join Date: Mar 2015
Location: Russia
Device: Kindle Paperwhite
|
ecostin, Is it possible in this way to adjust the margins?
|
03-10-2015, 05:25 AM | #7 |
Enthusiast
Posts: 37
Karma: 160968
Join Date: Sep 2010
Location: Germany
Device: PRS-500-505-700, Kindle3, KT, KPW, KPW2, KV, KOA
|
|
03-11-2015, 12:12 PM | #8 | |
Wizard
Posts: 3,033
Karma: 53000001
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
|
Quote:
Shari |
|
03-11-2015, 01:11 PM | #9 | |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
But Amazon has discontinued that in more recent firmwares. Last edited by knc1; 04-24-2015 at 02:44 PM. |
|
03-11-2015, 01:43 PM | #10 |
BLAM!
Posts: 13,497
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
|
03-11-2015, 02:09 PM | #11 |
Wizard
Posts: 3,033
Karma: 53000001
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
|
All right. I'm going to try this, but I need some hand holding. So I create 2 text files named FONT_RAMP and CJK_FONT_RAMP and in each of them I put in the values of 7.49 8.43 9.37 10.31 11.25 12.19 13.13 14.07 and save the file. I then copy the files into the root of my Kindle drive when it is connected via USB. Is this correct?
Shari |
03-11-2015, 03:07 PM | #12 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
|
03-11-2015, 05:09 PM | #13 | |
Connoisseur
Posts: 58
Karma: 100000
Join Date: May 2009
Location: EU
Device: Cybook (Gen3, Opus), K3, K4NT, PW, PW2, KV
|
Quote:
Edit: BTW, you have to restart to take affect. Last edited by tono1020; 03-11-2015 at 05:12 PM. |
|
03-11-2015, 06:10 PM | #14 |
Wizard
Posts: 3,033
Karma: 53000001
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
|
|
03-19-2015, 07:36 AM | #15 |
Addict
Posts: 250
Karma: 136662
Join Date: Apr 2011
Device: N/A
|
|
Tags |
font_ramp |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to edit margins in MOBI file? | WDeranged | Calibre | 2 | 09-03-2015 06:43 PM |
Default Edit Book Edit Window Font? | lhuxley | Editor | 2 | 03-27-2015 12:11 AM |
Kindle Paperwhite edit PDF margins? | bseos | Amazon Kindle | 8 | 02-10-2014 03:00 PM |
Edit Default Kindle PW Font Sizes | mthodmn101 | Kindle Developer's Corner | 10 | 09-20-2013 12:14 PM |
Kindle margins edit? | 3bayjunkie | Amazon Kindle | 3 | 01-02-2011 12:38 AM |