MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Issues scrolling the cursor (https://www.mobileread.com/forums/showthread.php?t=59129)

ghostyjack 10-12-2009 03:52 PM

Issues scrolling the cursor
 
I converted several books into HTML (for conversion into epub) but for some reason the conversion went wrong and all the paragraphs in a chapter merged into one. The books ended up with between 20-50 massive paragraphs (one per chapter) with no way to figure out what the actual paragraphs were.

This meant breaking out the original paper books and going through each chapter line-by-line to figure out the proper paragraphs. This may take some time, but it had to be done.

Now, when I do this I'm normally got the book in one hand and visually scanning down the page, while my other hand manipulated the cursor and enter keys.

In a regular text editor this would be fine but I've been coming across a couple of issues that this a bit of a pain.

1. If there is any italic text withing the paragraph below, as I scroll across to the correct ending point of the paragraph, the cursor can randomly jump to the italic text and then jump back to where it should be and then continues on the line. This wouldn't caus me too much of a problem except for the fact that the page will suddenly jump and scoll as much as a full screen of text and then jump back. This gets very disorienting.

2. The larger the paragraph the slower it takes to scroll. I press and hold the left of right scroll button and the cursor moves just one place. I leave my finger on the cursor key and the cursor doesn't move, except that when I take my finger off, the cursor jumps several characters. This makes it difficult to tell where the cursor actually is.

Are these things worth raising as an issue or are these an issue with Qt?

Valloric 10-12-2009 08:24 PM

Quote:

Originally Posted by ghostyjack (Post 623632)
1. If there is any italic text withing the paragraph below, as I scroll across to the correct ending point of the paragraph, the cursor can randomly jump to the italic text and then jump back to where it should be and then continues on the line. This wouldn't caus me too much of a problem except for the fact that the page will suddenly jump and scoll as much as a full screen of text and then jump back. This gets very disorienting.

2. The larger the paragraph the slower it takes to scroll. I press and hold the left of right scroll button and the cursor moves just one place. I leave my finger on the cursor key and the cursor doesn't move, except that when I take my finger off, the cursor jumps several characters. This makes it difficult to tell where the cursor actually is.

Are these things worth raising as an issue or are these an issue with Qt?

Ok, so for your first problem...

You're editing in Book View, right? Then the problem is with WebKit which Qt integrates. To tell you the truth, WebKit is starting to piss me off as much as HTML Tidy (and Tidy has pissed me off a truly great deal). While I can usually beat Tidy into submission by diving into its source code and fixing things, I can't really do this with WebKit.

Doing it for WebKit would mean diverging from the vanilla Qt distributed by Nokia, and that's not something I'm eager to do. It would mean the default Qt libs for Linux systems would no longer apply and people would have to download and compile this custom Qt version if they wanted to compile Sigil directly. Did I mention it takes ~4 hours to compile Qt? And working on the Apple upstream version of WebKit is pointless since Nokia updates their port every six months.

Then there's the elephant in the room: WebKit's huge. It's a whole browser engine, used in Safari and Chrome and a multitude of other applications. Hundreds of thousands of lines of code. Just familiarizing myself with the internal architecture would probably take a couple of months.

So I'm building up frustration with it until I say "oh to hell with it" and then diverge from vanilla Qt and WebKit. I'm currently holding out until Qt 4.6 which should be out in a month or so. If that doesn't solve some of my major grievances, it will be time for more extreme measures.

So for your first problem... yeah I don't know what to tell you. Use the Code View, that shouldn't have these problems. Just paste "</p><p>" where you want one paragraph to end and another to begin.

Also create an issue on the tracker with this, providing the step-by-step instructions to replicate it. Maybe I'm doing something stupid to mess this up, but I highly doubt it.

For your second problem... well you have a whole chapter as a paragraph, and Book View is justifying the text. Try setting it to left-justified while you work on it, it should speed up. But the problem remains, you have a whole chapter worth of text in a single <p> element. That will hurt every HTML renderer, no matter what.

You should also see massive speed-ups with this when 0.2.0 ships with the multi-flow redesign, since you'll be able to split these paragraph chapters into different XHTML files and work on them one by one. This should relieve WebKit's pain.

Valloric 10-12-2009 08:35 PM

One more thing... why don't you just work on raw text here? You said the HTML conversion went bad and now you have all the chapters as one paragraph. That's hardly HTML.

Open your favourite simple text editor (I suggest Notepad++) and make the text look like this:

Quote:

paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph

paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph

paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph paragraph
You get the point. Make sure you have a line between the different paragraphs, and Sigil will pick up on this during TXT import and convert these to proper HTML paragraphs.

ghostyjack 10-13-2009 09:43 AM

Thanks for this.

Yes I am doing it in Book View as under normal circumstances, I don't have to mess with adding paragraph formatting as Sigil does it automatically. I suspected this might not be an issue with Sigil.

I'll raise an issue about the first point.

As to the second point: I've tried copying in raw text in the past by having a blank line between paragraphs and this works fine if my text is wrapped in the text editor. But if I have a text file which has hard breaks at the end of the line and is not wrapped, Sigil will create the paragraph but merges the end of the previous line with the start of the next line.

e.g. I "getthis". I should "get this". This means I have to go line-by-line to find all the merged words.

Looks like I might need to do most of my editing outside of Sigil, I was trying to move away from that and get the basic book structure complete within the one tool. Not to worry, I'm sure Sigil will mature to the point that it will be the one-stop-shop I need for this. I'll still keep using it as it is an excellent program and am (in general) loving the way it works.

BTW, never used Notepad++, I normally use Edit+. Might give Notepad++ a try and see which is better.

Valloric 10-13-2009 11:14 AM

Quote:

Originally Posted by ghostyjack (Post 624288)
As to the second point: I've tried copying in raw text in the past by having a blank line between paragraphs and this works fine if my text is wrapped in the text editor. But if I have a text file which has hard breaks at the end of the line and is not wrapped, Sigil will create the paragraph but merges the end of the previous line with the start of the next line.

e.g. I "getthis". I should "get this". This means I have to go line-by-line to find all the merged words.

Don't copy the text directly into Book View, import your text file. Then Sigil will create paragraphs only where you have an empty line between blocks of text. This will prevent things like "getthis" from happening.

ghostyjack 10-13-2009 02:01 PM

I mean't import, but haven't tried importing raw text since 0.1.2. I'll give it another go and see if this help one of my issues.

ghostyjack 10-13-2009 02:22 PM

I've just tried importing text from a txt file and am again getting the words merging. This is using v0.1.4.

I think I see why though: If there is a space just before the carriage return, importing the text will cause two words. If there is no space before the carriage return, I get one merged word.

So for this to work I'm going to need to check every text file to see if they are word wrapped. And if they are not, add a space before every carriage return. Not what I had hoped for, but can do it if I have to. :(

But you are right, if there is a blank line in the text file, I'll get a new paragraph. So thats good.

Valloric 10-13-2009 04:52 PM

Quote:

Originally Posted by ghostyjack (Post 624569)
I think I see why though: If there is a space just before the carriage return, importing the text will cause two words. If there is no space before the carriage return, I get one merged word.

That's a bug. Report it on the tracker with a test case and I'll fix it.

ghostyjack 10-14-2009 05:38 AM

I've created issue #147 for the jumping to italics, and issue #148 for the merging of the text.

plazec 10-15-2009 06:13 AM

Quote:

Originally Posted by Valloric (Post 623864)
Ok, so for your first problem...

You're editing in Book View, right? Then the problem is with WebKit which Qt integrates. To tell you the truth, WebKit is starting to piss me off as much as HTML Tidy (and Tidy has pissed me off a truly great deal). While I can usually beat Tidy into submission by diving into its source code and fixing things, I can't really do this with WebKit.

Doing it for WebKit would mean diverging from the vanilla Qt distributed by Nokia, and that's not something I'm eager to do. It would mean the default Qt libs for Linux systems would no longer apply and people would have to download and compile this custom Qt version if they wanted to compile Sigil directly. Did I mention it takes ~4 hours to compile Qt? And working on the Apple upstream version of WebKit is pointless since Nokia updates their port every six months.

Then there's the elephant in the room: WebKit's huge. It's a whole browser engine, used in Safari and Chrome and a multitude of other applications. Hundreds of thousands of lines of code. Just familiarizing myself with the internal architecture would probably take a couple of months.

So I'm building up frustration with it until I say "oh to hell with it" and then diverge from vanilla Qt and WebKit. I'm currently holding out until Qt 4.6 which should be out in a month or so. If that doesn't solve some of my major grievances, it will be time for more extreme measures.

Is Webkit the same reason for overal Sigil slowness when reflowing text after windows resizing, text editing etc. ?

http://www.youtube.com/watch?v=G60agHsYkPM
recorded on Win Vista, Intel C2Q6600 with 4GB RAM. It should be faster :D

Valloric 10-15-2009 09:10 AM

Quote:

Originally Posted by plazec (Post 626362)
Is Webkit the same reason for overal Sigil slowness when reflowing text after windows resizing, text editing etc. ?

Yes, it is. The multi-flow redesign will help with this too, since you won't have one 20k XHTML flow, but one for each chapter. WebKit's performance degrades proportionally to the size of the document loaded.

Quote:

Originally Posted by plazec (Post 626362)
It should be faster :D

I agree. And it's going to be.


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

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.