Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 09-10-2015, 02:52 PM   #1
JavaJim
Junior Member
JavaJim began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Location: Sundridge, ON, CA
Device: Nexus4
Some characters (* + - /) not displaying

I have a book about coding that puts the code examples in a different font (mono-spaced). The code examples show up fine - except the math operators are not visible. The dead-tree version of the book does not use a different colour for the symbols. I know the symbols are actually there because if I copy/paste out of Calibre the correct symbols are pasted. I used the book editor to view the html source - I can't find anything in the html that would cause the operators to display any differently.

Any ideas?

Calibre 2.37.1
Windows 7
JavaJim is offline   Reply With Quote
Old 09-10-2015, 03:26 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,996
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
As they say:

Show me the code: (for a bad paragraph or Div)
show the portions CSS for that code
Please use a spoiler tag if more than a dozen lines
theducks is online now   Reply With Quote
Advert
Old 09-11-2015, 08:39 AM   #3
JavaJim
Junior Member
JavaJim began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Location: Sundridge, ON, CA
Device: Nexus4
First let me say that none of this is my own - in case it sounded like it was a book I wrote.

The NoOperatorsScreen.png attached is a piece of a screenshot showing how it displays.

The NoOperatorsLiveCSS.png is the LiveCSS view produced from the editor (I've also copied the CSS below the HTML).

Here is the HTML for the paragraph
Code:
<p class="pre">&gt; 4 * 6 + 5<br class="calibre5"/><br class="calibre5"/>[1] 29<br class="calibre5"/><br class="calibre5"/>&gt; (4 * 6) + 5<br class="calibre5"/><br class="calibre5"/>[1] 29<br class="calibre5"/><br class="calibre5"/>&gt; 4 * (6 + 5)<br class="calibre5"/><br class="calibre5"/>[1] 44</p>
Here is the same HTML for the paragraph - but I have edited it for formatting reasons (at each <br>)
Code:
<p class="pre">&gt; 4 * 6 + 5<br class="calibre5"/>
<br class="calibre5"/>
[1] 29<br class="calibre5"/>
<br class="calibre5"/>
&gt; (4 * 6) + 5<br class="calibre5"/>
<br class="calibre5"/>
[1] 29<br class="calibre5"/>
<br class="calibre5"/>
&gt; 4 * (6 + 5)<br class="calibre5"/>
<br class="calibre5"/>
[1] 44</p>

CSS for class="pre"
Code:
.pre {
    display: block;
    font-family: "Courier New";
    font-size: 0.75em;
    text-align: left;
    margin: 10pt 0 10pt 20pt
    }
CSS for class="calibre" (this is the class for <body>)
Code:
.calibre {
    display: block;
    font-size: 1em;
    padding-left: 0;
    padding-right: 0;
    margin: 0 5pt
    }
CSS for class="calibre5"
Code:
.calibre5 {
    display: block
    }
Attached Thumbnails
Click image for larger version

Name:	NoOperatorsScreen.PNG
Views:	170
Size:	1.9 KB
ID:	141900   Click image for larger version

Name:	NoOperatorsLiveCSS.PNG
Views:	194
Size:	49.8 KB
ID:	141901  

Last edited by JavaJim; 09-11-2015 at 08:42 AM.
JavaJim is offline   Reply With Quote
Old 09-11-2015, 10:33 AM   #4
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,996
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I made 1 change (just for a fallback if the named font is unavailable, a good practice )

Where are you seeing colored/missing symbols? Your device?

Code editors (like used in the editor) Encode Syntax of various parts for readability display ONLY


The code is simple, basic HTML (no color calls) for the OUTPUT
Attached Files
File Type: epub simplemath.epub (2.1 KB, 145 views)
theducks is online now   Reply With Quote
Old 09-11-2015, 10:45 AM   #5
JavaJim
Junior Member
JavaJim began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Location: Sundridge, ON, CA
Device: Nexus4
I tried your fix - no go. I've also played with background and foreground colours, as well as different fonts. Still not displaying.

(Your file displays though.)

This is occurring in Calibre reader, on Windows 7, laptop. Nothing exotic.
JavaJim is offline   Reply With Quote
Advert
Old 09-11-2015, 11:15 AM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,996
Karma: 57259778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I don't think there is any differences between Calibres for various Windows versions

I suspect you have a ebook-viewer configuration override in place

Use the Restore Defaults button at the bottom of the viewer config screen

Look at the same book using the Editor Preview pane. The viewer allows stylesheets to be overridden (although, the inspector does not indicate this)

Could the monospaced font on your system be damaged (modified)?
theducks is online now   Reply With Quote
Old 09-11-2015, 11:34 AM   #7
JavaJim
Junior Member
JavaJim began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Location: Sundridge, ON, CA
Device: Nexus4
BINGO!

Haven't investigated yet to see if the "Courier New" font is damaged, but forcing a different mono-spaced font (via the stylesheet) shows the characters.

Thanks for your help.

Jim
JavaJim is offline   Reply With Quote
Old 09-11-2015, 11:40 AM   #8
JavaJim
Junior Member
JavaJim began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Jul 2014
Location: Sundridge, ON, CA
Device: Nexus4
Previously I was making changes in the reader settings (to try a new font, etc.) but didn't realize a stylesheet was overriding it. (I've learned a lot about what an epub is over the last couple of days).

Thanks again,
Jim
JavaJim is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Chinese characters John123 Workshop 11 05-05-2015 09:50 AM
Displaying Chinese? Characters Rand Brittain ePub 8 04-05-2014 01:51 PM
Displaying french characters on Japanese Kindle PW Tekeur Amazon Kindle 6 05-04-2013 10:12 AM
KoboTouch displaying boxes instead of cyrillic characters mewakitty Kobo Reader 8 07-29-2012 07:05 AM
CE characters not displaying citac Sigil 18 10-08-2010 08:07 AM


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


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