-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some notes about thornyreader crengine fork #267
Comments
That was fast. :-)
Not sure what you mean by that but also see our #39.
Yeah, plus HarfBuzz does it for Persian, etc., etc. |
Not sure, not my words :) Didn't mention it above, but they did indeed many updates/fixes to the little document formats, like mobi (they included another library to do that), txt, rtf, docx... |
@poire-z The repo seems to have vanished. O_o Do you still have a local copy? |
FWIW, it looks like the author's GitHub account is still active. I just tried sending an email, requesting temporary access to the repo. |
Yes, I do have a local copy. |
Here is another copy of thornyreader: https://github.com/readera/thornyreader @poire-z You are allowed to make it available again, since Cool Reader is released under the GPL license. By the way, thornyreader has license problems, LICENSE files contains GNU AGPL which is not compatible with the GPL license of Cool Reader. And the source code of ReadEra is not published. |
@poire-z You may want to write the author first anyway, of course, maybe he has reasons to try to remove this repository. I guess it was just moved to readera organization without announcement. |
Thanks for finding that one. |
FWIW, I did contact the original author and got a reply. Apparently, they were developing thornyreader for their employer and got strong-armed into taking the repo down. It seems like they personally would like the repo to be available, but it's unclear to me whether the patchset is legally usable. The GPL only guarantees source availability once the binaries have been distributed, no? |
Yes. But the binaries are distributed both on https://readera.ru/reader-book and https://play.google.com/store/apps/details?id=org.readera ReadEra uses Cool Reader based engine, which is licensed under GPL. GPL does not require authors to publish the source, but any user can demand the source code from them. And since binaries are freely distributed, you can easily become the user. EDIT: I would not contact the ReadEra with these demands, though. Better contact the authors directly to avoid any consequences for them (though not following the GPL is obviously their employer's fault). |
It may be not legally usable in one corner case: if the authors took some code that was licensed under the GPL-incompatible license and used it in their GPL software fork. That would be illegal in the first place so the GPL cannot make this combined codebase legal even if the users were not aware of the origin of the code. |
As I mentionned in the first post, there is really not much we'd want to borrow, or even could borrow (because their use of crengine looked so different than ours). So, no real need to get answers to these legal questions. |
Now that we got DocX support from upstream, and our own RTL/Bidi support, nothing much to pick from that fork. //epub3 series metadata
if(series.empty()) {
struct titleitem { lString16 title; lString16 id; };
LVArray<titleitem> titles;
for (int i = 1; i < 20; i++) {
lString16 xpath = lString16("package/metadata/title[") << fmt::decimal(i) << "]";
ldomNode *item = dom->nodeFromXPath(xpath);
if (!item)
break;
titleitem curr;
curr.id = item->getAttributeValue("id");
curr.title = item->getText().trim();
titles.add(curr);
}
lString16 series_id;
for (int i = 1; i < 20; i++) {
lString16 xpath = lString16("package/metadata/meta[") << fmt::decimal(i) << "]";
ldomNode *item = dom->nodeFromXPath(xpath);
if (!item)
break;
lString16 property = item->getAttributeValue("property");
lString16 content = item->getText().trim();
if (property == "collection-type" && content == "series") {
series_id = item->getAttributeValue("refines");
if (series_id.startsWith("#"))
series_id = series_id.substr(1, series_id.length() - 1);
break;
}
}
if (!series_id.empty()) {
for (int i = 0; i < titles.length(); i++) {
titleitem curr = titles.get(i);
if (curr.id == series_id) {
series = curr.title;
break;
}
}
for (int i = 1; i < 20; i++) {
lString16 xpath = lString16("package/metadata/meta[") << fmt::decimal(i) << "]";
ldomNode *item = dom->nodeFromXPath(xpath);
if (!item)
break;
lString16 refines = item->getAttributeValue("refines");
lString16 property = item->getAttributeValue("property");
lString16 content = item->getText().trim();
if (refines == series_id && property == "group-positon") {
series_number = content.atoi();
break;
}
}
}
}
//if series still empty: last attempt, for property="belongs-to-collection"
if(series.empty()) {
lString16 series_id;
for (int i = 1; i < 20; i++) {
lString16 xpath = lString16("package/metadata/meta[") << fmt::decimal(i) << "]";
ldomNode *item = dom->nodeFromXPath(xpath);
if (!item)
break;
lString16 property = item->getAttributeValue("property");
if (property == "belongs-to-collection") {
series = item->getText().trim();
series_id = item->getAttributeValue("id");
break;
}
}
if(!series_id.empty() && series_number == 0) {
for (int i = 1; i < 20; i++) {
lString16 xpath = lString16("package/metadata/meta[") << fmt::decimal(i) << "]";
ldomNode *item = dom->nodeFromXPath(xpath);
lString16 property = item->getAttributeValue("property");
lString16 id = item->getAttributeValue("refines");
if (id.startsWith("#"))
id = id.substr(1, id.length() - 1);
if (id == series_id && property == "group-position") {
series_number = item->getText().trim().atoi();
break;
}
}
}
} |
All the interesting stuff in bold has since been implemented via some original work. |
New active fork of crengine found by @pazos at koreader/koreader#4745 (comment):
https://github.com/irrationalunzen/thornyreader thornyreader
Spent the evening reading
git log -p
... so sharing some observations:Some noticable stuff they added/changed (in bold, the things that could be of interest to us):
(the commit links I linked to is usually the most interesting one in the set - but the features come each with many many commits and later fixes).
https://github.com/irrationalunzen/thornyreader/pull/50 https://github.com/irrationalunzen/thornyreader/pull/51
Embedded styles support (?!) with a new parser/object , "class" oriented (@frankyifei 's multi classnames fixes might have avoided us the need for that kind of stuff)https://github.com/irrationalunzen/thornyreader/pull/49
RTL right-to-left / BIDI support possibly the most interesting - it started withDrawTextString(... bool reverse)
but things ended up with https://github.com/irrationalunzen/thornyreader/commit/59e8058954fccf560f1e42b2ed501282c98d3601 "Moved most RTL-related features to a separate file", so it's in include/rtlhandler.h and src/rtlhandler.cpp - and some use of that at parsing time and in lvtextfm.cpp. Probably not usable as is - and there are lots of arabic char codes, so they do the positionning/sizing/rendering manually - while we could probably have harfbuzz do some of that, as it already renders/draw individual words in rtl. But it's definitely something to read to see how we could start to go at that.(so, in bold, the things that could be of interest to us - even if I'm not particularly interested by any of them :) but I'll surely be reading that RTL stuff - just to see how easy or risky it would be in regards to all the LTR text fixes we added).
The text was updated successfully, but these errors were encountered: