View Single Post
Old 01-30-2011, 02:08 PM   #194
mtravellerh
book creator
mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.mtravellerh ought to be getting tired of karma fortunes by now.
 
mtravellerh's Avatar
 
Posts: 9,657
Karma: 3856660
Join Date: Oct 2008
Location: Luxembourg
Device: Kindle Scribe
Quote:
Originally Posted by JimStar View Post
At first, sorry my English.
So I carried out some research.
AdobeViewer library problem is common to all devices, so it will not work properly with ePub files in all devices that use it. PocketBook - uses it if you open ePub file with AdobeViewer. So, it will not work properly with ePub and it not works with dictionary in ePub files opened in AdobeViewer.

But in FBreader - PocketBook has a stupid BUG that I've found. With ePub files that have formatting. In the file XHTMLReader.cpp (my comments are in the code):

Code:
void XHTMLReader::characterDataHandler(const char *text, int len) {
        if (myPreformatted) {
                if ((*text == '\r') || (*text == '\n')) {
                        myModelReader.addControl(CODE, false);
                        myModelReader.endParagraph();
                        myModelReader.beginParagraph();
                        myModelReader.addControl(CODE, true);
                }
                int spaceCounter = 0;

                //Look at this loop 
                //If we got a string that has a whitespace as its first character,
                //then spaceCounter will be ALWAIS set to FULL LENGTH OF STRING,
                //so ALWAIS such a string will be not printed on the screen!
                //A stupid BUG in all production versions of devices...
                while ((spaceCounter < len) && isspace((unsigned char)*text)) {
                        ++spaceCounter;
                }

                myModelReader.addFixedHSpace(spaceCounter);
                text += spaceCounter;
                len -= spaceCounter;
        }
        if (len > 0) {
                myModelReader.addData(std::string(text, len));
        }
}
All what PocketBook developers need to make - is to add current count of witespaces to the string pointer:
Code:
while ((spaceCounter < len) && isspace((unsigned char)*(text + spaceCounter))) {
        ++spaceCounter;
}
It's all. At this time developers not fixed it and not answered to my mail. And banned me on their russian forum.
Welcome. Plain bug indeed, but, to put things right:

You were not banned for this and ebook.org does not belong, in any way, to PB.
mtravellerh is offline   Reply With Quote