Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-17-2007, 10:20 AM   #391
Excalibur
Member
Excalibur began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2007
Device: Sony eReader 500
Well, I tried it in Firefox and it renders with two spaces. IE is wrong when it comes to rendering HTML properly. Anyway, I tried it in IE and it does incorrectly render with 1 space.

So, which do you go with? Standards compliant Firefox or non-standards compliant IE. Either way, you could just as easily remove any whitespace at the beginning of a non-pre tag and that will fix said issue. If the tag has CSS that says it is white-space:pre; then you can check that before removing the space at the beginning of a tag and determine if you need to remove it or not.

hmm I forgot what started this conversation anyway... heh
Excalibur is offline   Reply With Quote
Old 08-17-2007, 10:27 AM   #392
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
firefox and konqueror in linux render it with one space. I suspect firefox on windows is broken. Certainly redering it with one space is logically correct. No you cant blindly remove leading space, consider the following situation

Code:
<p>One,<span> two
Just need to remember the last string added, shouldn't be too hard to do.
kovidgoyal is offline   Reply With Quote
Old 08-17-2007, 10:51 AM   #393
Excalibur
Member
Excalibur began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Aug 2007
Device: Sony eReader 500
Well, it "looks" like one space but it is 2 spaces in source... I guess it does collapse it in the browser window then...

True enough.
Excalibur is offline   Reply With Quote
Old 08-17-2007, 04:43 PM   #394
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Released v0.3.98 with support for white-space. This required a complete rewrite of html2lrf's whitespace handling mechanism, so keep an eye out for whitespace related problems. The new code is actually simpler than the old, but not tested nearly as much ;-)

Also fixed the lit2lrf, any2lrf bugs on windows.
kovidgoyal is offline   Reply With Quote
Old 08-17-2007, 06:11 PM   #395
Pode
Member
Pode began at the beginning.
 
Pode's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2007
Location: France
Device: Sony Reader
kovidgoyal>here's an attached .lrf, with an example of line-centered text.
It's an article from the New York Time, taken as an html page, and converted with html2lrf.
If you go on the last page, you can see a list of items, centered.
If I understood well, what you want (and others on the forum too) is centered text on the reader.

Centered text like that pops in nearly all my lrf files, because a lot, if not all of them comes from saved web pages, poorly stripped of their screen-waste content. So I suppose that when I get centered text, it's because, even if I cut "with an axe" through the html code, css definition still (badly) applies to what's left...
Attached Files
File Type: lrf 07indu.lrf (11.3 KB, 237 views)
Pode is offline   Reply With Quote
Old 08-17-2007, 06:18 PM   #396
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
If you go on the last page, you can see a list of items, centered.
That's horizontal centering. The O.P. was asking about vertical centering.

Last edited by kovidgoyal; 08-17-2007 at 06:26 PM.
kovidgoyal is offline   Reply With Quote
Old 08-17-2007, 06:20 PM   #397
irishjew
Enthusiast
irishjew doesn't litteririshjew doesn't litter
 
Posts: 33
Karma: 108
Join Date: Jul 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
the <a href> tag is inside a <pre> tag. Delete the <pre> tag and you'll be fine.
Thanks a bunch, Kovid. I did that, and it fixed the links, but unfortunately now all my line breaks and tabs are gone. Do you know what might cause that?
irishjew is offline   Reply With Quote
Old 08-17-2007, 06:25 PM   #398
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
upgrade to the latest version and put the <pre> tags back and you should have both links and line breaks.
kovidgoyal is offline   Reply With Quote
Old 08-17-2007, 07:45 PM   #399
irishjew
Enthusiast
irishjew doesn't litteririshjew doesn't litter
 
Posts: 33
Karma: 108
Join Date: Jul 2007
Device: Sony Reader
Quote:
Originally Posted by kovidgoyal View Post
upgrade to the latest version and put the <pre> tags back and you should have both links and line breaks.
I upgraded, and the links are there, but they don't point to the right places. Instead, they all go back to the beginning of the file.
irishjew is offline   Reply With Quote
Old 08-18-2007, 01:59 AM   #400
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by irishjew View Post
I upgraded, and the links are there, but they don't point to the right places. Instead, they all go back to the beginning of the file.
Hmm that shouldn't be happening please send me the file.
kovidgoyal is offline   Reply With Quote
Old 08-18-2007, 06:01 AM   #401
Pode
Member
Pode began at the beginning.
 
Pode's Avatar
 
Posts: 22
Karma: 10
Join Date: Mar 2007
Location: France
Device: Sony Reader
kovidgoyal>OK, it seems I misunderstood. Excuse-me for any false hope.
Pode is offline   Reply With Quote
Old 08-18-2007, 09:05 AM   #402
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,762
Karma: 145864619
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
So any idea when the next version is going to be released? The one that fixes html2lrf.
JSWolf is online now   Reply With Quote
Old 08-18-2007, 11:12 AM   #403
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Later today.
kovidgoyal is offline   Reply With Quote
Old 08-18-2007, 12:58 PM   #404
angelyne
Connoisseur
angelyne is on a distinguished road
 
Posts: 57
Karma: 50
Join Date: Jun 2007
Device: Sony Reader PRS-500
I'm having a small problem.

I have a sentence that is coded like this : <p class="first">G<em>ram called at five in the morning. She never remembered</em> which looks like this

Gram called at five in the morning. She never remembered the time difference.

I don't like the fact that the first letter is not italics. It looks funny. I also wanted the first letter to be a drop cap. So I changed the code to this :

<p class="first"><em><big class='libprs500_dropcaps'>G</big>ram called at five in the morning. She never remembered</em>

The result looks fine in a browser, but doesn't convert well. The result is the first letter is in italics and drop-capped, but the rest of the sentence looses the italics.

It looks like this

G ram called at five in the morning.
angelyne is offline   Reply With Quote
Old 08-18-2007, 01:03 PM   #405
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,359
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I tried that. For me, the the entire statement is italicized, as would be expected from the HTML
Code:
<em><big class='libprs500_dropcaps'>G</big>ram called at five in the morning. She never remembered</em>
Attached Files
File Type: lrf angel.lrf (1.2 KB, 263 views)

Last edited by kovidgoyal; 08-18-2007 at 01:07 PM.
kovidgoyal is offline   Reply With Quote
Reply

Tags
html2lrf, libprs500


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font of header for LRF Output on PRS 505 duckbill Calibre 3 05-15-2010 11:07 AM
Pissed off with LRF formatting: LRF/LRS clean tool? grimborg LRF 8 02-15-2010 01:14 PM
Fonts for LRF output krischik Calibre 1 10-03-2009 05:01 AM
CBZ > LRF (LRF>HTML/MOBI????) sideburnt Calibre 4 09-15-2009 06:44 AM
libprs500 Issues Converting .LIT to .LRF - .LRF crashes everything vasbinde Calibre 6 02-14-2008 12:16 PM


All times are GMT -4. The time now is 03:55 PM.


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