Thread: KFX Format
View Single Post
Old 11-16-2015, 03:11 AM   #237
poxalew
Junior Member
poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.poxalew can program the VCR without an owner's manual.
 
Posts: 9
Karma: 166666
Join Date: Aug 2014
Device: Kindle PW2
Correct, it didn't. Amazon modified it (or, at least, merged stuff from elsewhere) and has open sourced it; I found some spare time and looked into it.

We can compare upstream https://trac.webkit.org/browser/rele.../Hyphenation.h (which is mostly a stub) to Source/WebCore/platform/text/Hyphenation.h from Amazon's tarball. The latter contains a reasonable hyphenation engine. It uses hunspell's dictionaries (telltale "hyph_en_US.dic" and "hyph_en_GB.dic" references in Hyphenation.cpp.) The code is reasonably well documented and quite readable. It's guarded by #ifdef LAB126 / #endif //LAB126 stanzas, so grepping for LAB126 through Amazon's source should yield interesting data.

So it looks like #1 is the case. #2 is right out (the source code dump doesn't even contain a JS interpreter and I doubt Amazon would have rolled their own for the same economic reasons for which they didn't reimplement rendering), and #3 indeed looks not to be the case.

Having the source is interesting in a number of ways, perhaps even for calibre if at some point in the future the JS hyphenation becomes a bottleneck and needs to be replaced with a lower runtime overhead implementation. Amazon's hyphenation implementation is BSD-licensed according to the copyright headers in the source files.

(By the way, my blanket statement about WebKit being LGPL was wrong; it's mostly BSD. LGPL governs just small parts of JavaScriptCore and a part of WebCore, but fortunately that was enough to force the entire WebCore into the open.)
poxalew is offline   Reply With Quote