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 01-05-2019, 07:52 PM   #1846
mergen3107
Connoisseur
mergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tongue
 
mergen3107's Avatar
 
Posts: 93
Karma: 22824
Join Date: Feb 2012
Location: Cape Canaveral
Device: KPW3 (5.9.7 JB); Kindle 4NT Black (4.1.3 JB)
Quote:
Originally Posted by Elendiar View Post
Can someone give additional info what to edit to fix this ?
I just left default smallest value as my new largest one. I use it only when skimming.
My values are (PW3): 16.98 7.55 5.00
mergen3107 is offline   Reply With Quote
Old 01-11-2019, 03:48 PM   #1847
Barty
doofus
Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.Barty ought to be getting tired of karma fortunes by now.
 
Barty's Avatar
 
Posts: 2,263
Karma: 7359115
Join Date: Sep 2010
Device: Voyage, PW2, Galaxy Tab S
Quote:
Originally Posted by mergen3107 View Post
I confirm working margins methods as described by stripe7.
KPW3, 5.9.7, English US.
I modified though not ReaderSDK-impl-en_GB.jar, but just ReaderSDK-impl.jar (which is default for English US).
I put 16.98, 11.32 and 7.55 for three types of margins.
7.55 for top/bottom/progressbar stuff.

One thing I don't understand with MOBI font sizes.
In Mobi-drawing.jar there are 8 font sizes listed, but the reader has a choice of 14. Plus it seems like the font size around 29 is the maximum 14th one, not 8th.
Font size 29 in MOBI is about the same size (visually) as the 14th one in KF8.
Spoiler:

Default FONT_RAMP values for KF8: 6.96 7.92 8.4 9.36 10.56 11.52 12.48 13.92 15.36 17.04 19.20 22.08 25.2 29.28

Default values for MOBI: 7.13 ; 7.81 ; 8.49 ; 9.17 ; 10.53 ; 12.56 ; 16.98 ; 29.2


Where are other 6 sizes?
On 5.9.7, the first 5 sizes for 300dpi are identical for mobi and azw3. Then it goes like this

Mobi azw3

6 7
7 9
8 14

I think the other in between values are interpolated. They couldn't bother with mobi, I guess.
Barty is offline   Reply With Quote
Old 01-13-2019, 02:55 PM   #1848
mergen3107
Connoisseur
mergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tongue
 
mergen3107's Avatar
 
Posts: 93
Karma: 22824
Join Date: Feb 2012
Location: Cape Canaveral
Device: KPW3 (5.9.7 JB); Kindle 4NT Black (4.1.3 JB)
@Barty,
Thank you!

I'll try them then.

UPDATE

@Barty, thank you again!
I put the appropriate values of KF8 (which all were initially chosen manually) into MOBI font sizes like this:
##1-5 identical
#6 = #7
#7 = #10
#8 = #14

Exact values are:
Spoiler:
Code:
#1   #2   #3   #4   #5    #6    #7    #8    #9    #10   #11   #12   #13   #14
8.42 8.84 9.26 9.68 10.10 10.52 10.94 11.36 11.78 12.20 12.62 13.04 13.46 13.88 (new KF8)

#1   #2   #3   #4   #5    #6    #7    #8    #9    #10   #11   #12   #13   #14
8.42 8.84 9.26 9.68 10.10 10.51 10.94 11.35 11.77 12.20 12.60 13.02 13.44 13.88 (new mobi)


It looks like there are some differences still, due to interpolation factors, but it is only about 0.02.

Yes, dictionary font size jumped to #3 = 9.26, which is larger than 8.49 by about 9%, but that's still fine.

Last edited by mergen3107; 01-15-2019 at 03:32 PM.
mergen3107 is offline   Reply With Quote
Old 01-22-2019, 09:04 PM   #1849
mergen3107
Connoisseur
mergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tongue
 
mergen3107's Avatar
 
Posts: 93
Karma: 22824
Join Date: Feb 2012
Location: Cape Canaveral
Device: KPW3 (5.9.7 JB); Kindle 4NT Black (4.1.3 JB)
Does anybody know how can we change fonts for kfx files?
After my alterations for mobi7 and kf8 above, downloaded books from Amazon look like they have default set of font sizes.
mergen3107 is offline   Reply With Quote
Old 01-24-2019, 01:00 PM   #1850
shamanNS
Evangelist
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 472
Karma: 1200116
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW3[300dpi] , Kindle PW1
Someone with actual Java skills could probably do it. Most likely place to look at would be "YJReader-impl.jar" file and inside that there is a class "YJBookController.class".

It contains references to "font.size.mapping" inside method named "axO":

Code:
...

private boolean debug = false;
private static final String aQi = "/mnt/us/CONTENT_FONT_RAMP";

...

public float[] axO() {
        float[] arrf;
        if (this.debug && (arrf = ReaderUtils.E((String)aQi, (int)this.mE().length)) != null && arrf.length > 0) {
            return arrf;
        }
        return (float[])ResourceBundle.getBundle(jb).getObject("font.size.mapping");
    }

The code is from firmware 5.9.7 for PW3.

As far as I've managed to understand the code if a field/member variable named "debug" wasn't set to "false" Kindle users would be able to re-define font sizes used for KFX books by creating a text file at "/mnt/us/CONTENT_FONT_RAMP" in the same way we can re-define font sizes for KF8 books by using "/mnt/us/FONT_RAMP".


So a Java & Java ByteCode guy that is well versed in decompiling & recompiling code would probably just need to "toggle" that "debug" variable value to enable parsing of "CONTENT_FONT_RAMP" file.



---------------------
EDIT: OK, I've just tested it an confirmed that it is working as expected.

So, the only thing that needs to be changed is line 15 of init method of "YJBookController.class"

before change:
Code:
iconst_0
putfield com/amazon/ebook/booklet/yjreader/impl/YJBookController/debug Z
after change:
Code:
iconst_1
putfield com/amazon/ebook/booklet/yjreader/impl/YJBookController/debug Z
Then just create "CONTENT_FONT_RAMP" with the same type of content (14 decimal/float type numbers) that you would use (or were already using, like I was) in "FONT_RAMP", reboot Kindle and it should work.

I noticed that KFX book will have slightly smaller font sizes for the same values... am to lazy to check if it because of the difference in "base font size" between two books or just Kindle using different "scaling" for those 2 book formats (KFX and KF8/AZW3).

Last edited by shamanNS; 01-24-2019 at 03:40 PM.
shamanNS is offline   Reply With Quote
Old 03-06-2019, 08:21 PM   #1851
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 2,412
Karma: 38715583
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₂ PW3₅.₁₀.₃
Quote:
Originally Posted by PoP View Post
Reasonable. Not holding my breath, I did...*write to amazon*...
In the mean time, inspired by

Quote:
Originally Posted by shamanNS View Post
Someone with actual Java skills could probably do it. Most likely place to look at would be "YJReader-impl.jar" file and inside that there is a class "YJBookController.class".

It contains references to "font.size.mapping" inside method named "axO":

...


The code is from firmware 5.9.7 for PW3.

...

So, the only thing that needs to be changed is line 15 of init method of "YJBookController.class"

before change:
Code:
iconst_0
putfield com/amazon/ebook/booklet/yjreader/impl/YJBookController/debug Z
after change:
Code:
iconst_1
putfield com/amazon/ebook/booklet/yjreader/impl/YJBookController/debug Z
...
I patched my PW3 5.10.3 similarly:

In this firmware version, references to "font.size.mapping" are inside method named "ayT"
Spoiler:
Click image for larger version

Name:	method ayT1.png
Views:	31
Size:	127.2 KB
ID:	170059


and the changes have to be made in method named init at line 27
Spoiler:
Click image for larger version

Name:	method init line 271.png
Views:	27
Size:	144.7 KB
ID:	170060


Now,
/mnt/us/CONTENT_FONT_RAMP
/mnt/us/CONTENT_CJK_FONT_RAMP
/mnt/us/CONTENT_INDIC_FONT_RAMP
properly trigger size overrides in KFX ebooks
PoP is offline   Reply With Quote
Old 03-07-2019, 08:57 AM   #1852
shamanNS
Evangelist
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 472
Karma: 1200116
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW3[300dpi] , Kindle PW1
Yeah, they re-obfuscate Java code with every (non bugfix??) firmware update so the name of the method that parses that txt file changes but so far that variable is still named "debug", at least since 5.9.x up to the latest firmware.

Did you also notice the difference in text size between KF8 and KFX books? For KFX text is smaller...

Last edited by shamanNS; 03-07-2019 at 08:59 AM.
shamanNS is offline   Reply With Quote
Old 03-07-2019, 02:32 PM   #1853
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 2,412
Karma: 38715583
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₂ PW3₅.₁₀.₃
Quote:
Originally Posted by shamanNS View Post
...
Did you also notice the difference in text size between KF8 and KFX books? For KFX text is smaller...
Yes I did, but could not locate where/why that happens in the java code.

Following screenshots show differences in the AZW3 and KFX formats of the Kindle User's Guide, with default behaviour and with overrides for sizes 1, 8, and 14:


Default behaviour:
Click image for larger version

Name:	SIZE 1 AZW3 screenshot_2019_03_07T13_20_27-0500.png
Views:	29
Size:	63.8 KB
ID:	170078Click image for larger version

Name:	SIZE 1 KFX screenshot_2019_03_07T13_20_45-0500.png
Views:	35
Size:	24.0 KB
ID:	170079Click image for larger version

Name:	SIZE 8 AZW3 screenshot_2019_03_07T13_23_11-0500.png
Views:	35
Size:	52.6 KB
ID:	170080Click image for larger version

Name:	SIZE 8 KFX screenshot_2019_03_07T13_22_56-0500.png
Views:	30
Size:	50.2 KB
ID:	170081Click image for larger version

Name:	SIZE 14 AZW3 screenshot_2019_03_07T13_21_32-0500.png
Views:	22
Size:	19.4 KB
ID:	170082Click image for larger version

Name:	SIZE 14 KFX screenshot_2019_03_07T13_21_13-0500.png
Views:	19
Size:	31.7 KB
ID:	170083

With FONT-RAMP and CONTENT_FONT-RAMP overrides
Code:
7.33 8.00 8.33 8.67 9.00 9.33 9.67 10.00 10.33 10.67 11.00 11.33 11.67 12.00
Overriden behaviour:
Click image for larger version

Name:	SIZE 1 AZW3 screenshot_2019_03_07T13_56_53-0500.png
Views:	32
Size:	65.8 KB
ID:	170086Click image for larger version

Name:	SIZE 1 KFX screenshot_2019_03_07T13_37_03-0500.png
Views:	34
Size:	26.0 KB
ID:	170087Click image for larger version

Name:	SIZE 8 AZW3 screenshot_2019_03_07T13_57_09-0500.png
Views:	28
Size:	52.8 KB
ID:	170088Click image for larger version

Name:	SIZE 8 KFX screenshot_2019_03_07T13_37_48-0500.png
Views:	31
Size:	38.5 KB
ID:	170089Click image for larger version

Name:	SIZE 14 AZW3 screenshot_2019_03_07T13_57_28-0500.png
Views:	33
Size:	49.9 KB
ID:	170090Click image for larger version

Name:	SIZE 14 KFX screenshot_2019_03_07T13_38_47-0500.png
Views:	24
Size:	48.2 KB
ID:	170091
PoP is offline   Reply With Quote
Old 03-07-2019, 03:22 PM   #1854
jhowell
Wizard
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 2,773
Karma: 25999999
Join Date: Nov 2011
Location: Florida
Device: Oasis 2, Fire, iPad Air 2, Nexus 7
Quote:
Originally Posted by PoP View Post
Following screenshots show differences in the AZW3 and KFX formats of the Kindle User's Guide, with default behaviour and with overrides for sizes 1, 8, and 14:
I looked at the first pair (size 1) in each group (default/overrridden) using an image editor and verified that the font size of the body text is identical in the AZW3 and KFX images. There are differences are in inter-character spacing, but that is expected with enhanced typesetting.

The font size of the headings are obviously different between the AZW3 and KFX version. I believe that it is likely an artifact of KFX conversion. It tends to reduce excessive font size variations and vertical spacing.
jhowell is offline   Reply With Quote
Old 03-07-2019, 03:42 PM   #1855
j.p.s
Wizard
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 2,040
Karma: 32881010
Join Date: Apr 2011
Device: pb360
I have no plans to read KFX books, but the collaboration in this thread is inspiring.
j.p.s is offline   Reply With Quote
Old 03-07-2019, 04:32 PM   #1856
PoP
 curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.PoP ought to be getting tired of karma fortunes by now.
 
PoP's Avatar
 
Posts: 2,412
Karma: 38715583
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₂ PW3₅.₁₀.₃
^ @jhowell Yeah, you nailed it
PoP is offline   Reply With Quote
Old 03-17-2019, 06:47 AM   #1857
kleinjar
Connoisseur
kleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refresheskleinjar can read faster than his screen refreshes
 
Posts: 57
Karma: 14210
Join Date: Jul 2015
Device: none
Quote:
Originally Posted by mergen3107 View Post
I confirm working margins methods as described by stripe7.
KPW3, 5.9.7, English US.
I modified though not ReaderSDK-impl-en_GB.jar, but just ReaderSDK-impl.jar (which is default for English US).
I put 16.98, 11.32 and 7.55 for three types of margins.
7.55 for top/bottom/progressbar stuff.

Do the new margins persist even when you exit a book, or do they keep reverting to the stock margins like described in post 1834?
kleinjar is offline   Reply With Quote
Old 03-17-2019, 06:19 PM   #1858
mergen3107
Connoisseur
mergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tonguemergen3107 can tie a knot in a cherry stem with his or her tongue
 
mergen3107's Avatar
 
Posts: 93
Karma: 22824
Join Date: Feb 2012
Location: Cape Canaveral
Device: KPW3 (5.9.7 JB); Kindle 4NT Black (4.1.3 JB)
Quote:
Originally Posted by kleinjar View Post
Do the new margins persist even when you exit a book
Yes! The margins changed permanently.
mergen3107 is offline   Reply With Quote
Reply

Tags
jbpatch, kindle touch hacks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 12:30 PM.


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