03-10-2011, 05:08 AM | #1 |
Junior Member
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 |
03-10-2011, 09:10 AM | #2 |
Sigil & calibre developer
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.
|
Advert | |
|
03-10-2011, 11:43 AM | #3 |
Junior Member
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.
|
03-10-2011, 12:09 PM | #4 |
Sigil & calibre developer
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.
|
03-10-2011, 12:58 PM | #5 |
Junior Member
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. |
Advert | |
|
03-10-2011, 01:14 PM | #6 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
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.
|
03-10-2011, 01:15 PM | #7 |
Wizard
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. |
03-10-2011, 04:58 PM | #8 | |
Junior Member
Posts: 4
Karma: 10
Join Date: Mar 2011
Location: Paris
Device: Samsung E60
|
Quote:
|
|
03-10-2011, 05:07 PM | #9 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
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.
|
03-10-2011, 05:09 PM | #10 |
Wizard
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. |
Tags |
sample code |
|
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 |