Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 03-07-2015, 04:14 PM   #1
ecostin
Enthusiast
ecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role model
 
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?
ecostin is offline   Reply With Quote
Old 03-07-2015, 05:42 PM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
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 05:45 PM.
NiLuJe is offline   Reply With Quote
Advert
Old 03-08-2015, 02:57 PM   #3
ecostin
Enthusiast
ecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role model
 
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");
}
This means that font sizes can be set without jb and without any patches, by creating said files (FONT_RAMP, CJK_FONT_RAMP) in the root of the USB partition. The content must be, for each file, exactly 8 float values, which correspond to the 8 different font sizes:
[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 03:12 PM. Reason: Those code tags are useful ;)
ecostin is offline   Reply With Quote
Old 03-08-2015, 03:15 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
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?
eschwartz is offline   Reply With Quote
Old 03-08-2015, 03:30 PM   #5
ecostin
Enthusiast
ecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role model
 
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 03:32 PM.
ecostin is offline   Reply With Quote
Advert
Old 03-09-2015, 10:07 AM   #6
gruvad
Junior Member
gruvad began at the beginning.
 
gruvad's Avatar
 
Posts: 1
Karma: 10
Join Date: Mar 2015
Location: Russia
Device: Kindle Paperwhite
ecostin, Is it possible in this way to adjust the margins?
gruvad is offline   Reply With Quote
Old 03-10-2015, 04:25 AM   #7
ecostin
Enthusiast
ecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role modelecostin is a good role model
 
Posts: 37
Karma: 160968
Join Date: Sep 2010
Location: Germany
Device: PRS-500-505-700, Kindle3, KT, KPW, KPW2, KV, KOA
Quote:
Originally Posted by gruvad View Post
ecostin, Is it possible in this way to adjust the margins?
Apparently not ... you need jb and you need to edit the Java classes. This is documented somewhere in this forum.
ecostin is offline   Reply With Quote
Old 03-11-2015, 11:12 AM   #8
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,032
Karma: 52740263
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by ecostin View Post
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.
Ok...so what does this mean? Can this be done without Jailbreak? Is it REALLY as simple as creating those two files and dropping them in the root of the Kindle drive when connected via USB? This would be an amazing thing, since one of my only formatting issues is with font size. I would LOVE to be able to have better choices there!

Shari
shalym is offline   Reply With Quote
Old 03-11-2015, 12:11 PM   #9
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by shalym View Post
Ok...so what does this mean?
Can this be done without Jailbreak?

Is it REALLY as simple as creating those two files and dropping them in the root of the Kindle drive when connected via USB?

This would be an amazing thing, since one of my only formatting issues is with font size.

I would LOVE to be able to have better choices there!

Shari
Some firmware versions, for some devices, recognize a USE_ALT_FONTS flag filename in USB storage.
But Amazon has discontinued that in more recent firmwares.

Last edited by knc1; 04-24-2015 at 01:44 PM.
knc1 is offline   Reply With Quote
Old 03-11-2015, 12:43 PM   #10
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
Quote:
Originally Posted by ecostin View Post
Code:
...
    float[] a = b.YTD("/mnt/us/FONT_RAMP");
...
...

[root@kindle log]# cat /mnt/us/FONT_RAMP
7.49 8.43 9.37 10.31 11.25 12.19 13.13 14.07
So, nope, USB root it is, vanilla's okay, provided it's >= 5.6.1
NiLuJe is offline   Reply With Quote
Old 03-11-2015, 01:09 PM   #11
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,032
Karma: 52740263
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by NiLuJe View Post
So, nope, USB root it is, vanilla's okay, provided it's >= 5.6.1
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
shalym is offline   Reply With Quote
Old 03-11-2015, 02:07 PM   #12
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by NiLuJe View Post
So, nope, USB root it is, vanilla's okay, provided it's >= 5.6.1
I read the post that I replied to as referring to the jar files.
("those two files" was a bit vague. )
knc1 is offline   Reply With Quote
Old 03-11-2015, 04:09 PM   #13
tono1020
Connoisseur
tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!tono1020 rocks like Gibraltar!
 
Posts: 58
Karma: 100000
Join Date: May 2009
Location: EU
Device: Cybook (Gen3, Opus), K3, K4NT, PW, PW2, KV
Quote:
Originally Posted by shalym View Post
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
Yes, that's correct, I tried it myself. You don't need CJK_FONT_RAMP, if you won't use chinese letters.

Edit: BTW, you have to restart to take affect.

Last edited by tono1020; 03-11-2015 at 04:12 PM.
tono1020 is offline   Reply With Quote
Old 03-11-2015, 05:10 PM   #14
shalym
Wizard
shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.shalym ought to be getting tired of karma fortunes by now.
 
shalym's Avatar
 
Posts: 3,032
Karma: 52740263
Join Date: Feb 2012
Location: New England
Device: PW 1, 2, 3, Voyage, Oasis 2 & 3, Fires, Aura HD, iPad
Quote:
Originally Posted by tono1020 View Post
Yes, that's correct, I tried it myself. You don't need CJK_FONT_RAMP, if you won't use chinese letters.

Edit: BTW, you have to restart to take affect.
THANK YOU!!! Now I won't have to choose between squint or huge for font sizes!!

Shari
shalym is offline   Reply With Quote
Old 03-19-2015, 06:36 AM   #15
hfpop
Addict
hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.hfpop knows how many angels can dance on the head of a pin.
 
Posts: 250
Karma: 136662
Join Date: Apr 2011
Device: N/A
Quote:
Originally Posted by ecostin View Post
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.
Has anyone tried to see whether the /mnt/us/FONT_RAMP file works on KPW1 5.4.4.2?
Thank you.
hfpop is offline   Reply With Quote
Reply

Tags
font_ramp

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to edit margins in MOBI file? WDeranged Calibre 2 09-03-2015 05:43 PM
Default Edit Book Edit Window Font? lhuxley Editor 2 03-26-2015 11:11 PM
Kindle Paperwhite edit PDF margins? bseos Amazon Kindle 8 02-10-2014 02:00 PM
Edit Default Kindle PW Font Sizes mthodmn101 Kindle Developer's Corner 10 09-20-2013 11:14 AM
Kindle margins edit? 3bayjunkie Amazon Kindle 3 01-01-2011 11:38 PM


All times are GMT -4. The time now is 03:27 AM.


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