Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 03-10-2011, 05:08 AM   #1
Oodini
Junior Member
Oodini began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Location: Paris
Device: Samsung E60
Text "out of screen"

Hello,

I converted a CHM to eBook. The book contains some sample codes.

After conversion, the code is truncated. The conversion process didn't add return carriages.

I don't know the CHM specifications, but it seems that the code samples is marked as code, and so is not reformated. Is it possible in Calibre to tell to reduce toe font size for this sample code ?

Thanks
Oodini is offline   Reply With Quote
Old 03-10-2011, 09:10 AM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
No. In this case calibre is doing exactly what the formatting is saying to do. Not reflow the text.
user_none is offline   Reply With Quote
Advert
Old 03-10-2011, 11:43 AM   #3
Oodini
Junior Member
Oodini began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Location: Paris
Device: Samsung E60
I uncompiled the CHM, and the sample code is in <pre> tags.
Oodini is offline   Reply With Quote
Old 03-10-2011, 12:09 PM   #4
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
pre tags prevent any type of wrapping from taking place. You can use the searc and relace feature to replace all pre tags with p tags. This will cause them to be wrapped and not display off the screen.
user_none is offline   Reply With Quote
Old 03-10-2011, 12:58 PM   #5
Oodini
Junior Member
Oodini began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Location: Paris
Device: Samsung E60
The pre tag has also some other features, so it isn't a good workaround.

I think the ePub format should deal this problem.

Or Calibre could remplace these tags with a font style setting a monotype face.

Last edited by Oodini; 03-10-2011 at 01:01 PM.
Oodini is offline   Reply With Quote
Advert
Old 03-10-2011, 01:14 PM   #6
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by Oodini View Post
I think the ePub format should deal this problem.
It's not a problem. It's part of the EPUB spec. The tag is a valid tag and like you said, it has a particular meaning. If you don't like the tag the only option is to edit the book and replace it with something else.
user_none is offline   Reply With Quote
Old 03-10-2011, 01:15 PM   #7
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
This is a problem with the source format. Epub is inherently an HTML based format, and if the HTML says do-not-reformat that is exactly what the epub is meant to do.

The right way to handle this is probably not to use <pre> tags, but instead use <p> tags associated with a css style that is defined to give you the behavior that you want to see. Unfortunately doing this will require manual work - calibre cannot do it automatically.
itimpi is offline   Reply With Quote
Old 03-10-2011, 04:58 PM   #8
Oodini
Junior Member
Oodini began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2011
Location: Paris
Device: Samsung E60
Quote:
Originally Posted by itimpi View Post
The right way to handle this is probably not to use <pre> tags, but instead use <p> tags associated with a css style that is defined to give you the behavior that you want to see. Unfortunately doing this will require manual work - calibre cannot do it automatically.
It should, because it could be useful to convert CHM initially created to be read on a computer screen, in an application with scrolling bars, to a document to be read on a e-paper device.
Oodini is offline   Reply With Quote
Old 03-10-2011, 05:07 PM   #9
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by Oodini View Post
It should, because it could be useful to convert CHM initially created to be read on a computer screen, in an application with scrolling bars, to a document to be read on a e-paper device.
It should not because again pre tags are valid per he EPUB spec. Calibre should never second guess valid content by default. However, this would be a good canadiate for a heuristic feature. If it doesnt already exist open a ticket at http://bugs.calibre-ebook.com and request it.
user_none is offline   Reply With Quote
Old 03-10-2011, 05:09 PM   #10
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
It's not as simple as just using <p> tags - because typically there are numerous carriage returns inside the <pre> tags that need to get converted to markup..

From a flow perspective it would be best if each <pre> tag was replace with a <div> or <blockquote> - blockquote is better if you want slightly indented code blocks and are planning to convert to mobi. Then the content of each individual <pre> tag needs to go through text processing with preserve spaces enabled. Finally a monospace font style would ideally need to be set.

That's all just the logical flow though, while Calibre has those individual capabilities it's not logic that's been chained together.

Edit: user_none is correct about the FR - this would be a good candidate for heuristics.
ldolse is offline   Reply With Quote
Reply

Tags
sample code


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Toshiba Dual Screen "netbook"/"laptop" kennyc News 18 06-23-2010 05:19 AM
How to make text "darker" and a bit smaller in conversions to LRF? Teddman LRF 2 02-10-2010 06:04 PM
File names with "(" and ")" can cause screen freezes greenapple Ectaco jetBook 5 02-04-2010 08:25 PM
"PK": Only text when I open in Sigil an ePub file generated with Calibre Terisa de morgan Sigil 3 12-14-2009 11:24 AM
Zune eBook Creator (RTextAsImage) - "Convert" text to images oleg.shastitko Reading and Management 10 01-28-2008 01:18 PM


All times are GMT -4. The time now is 05:33 AM.


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