Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Kobo Reader

Notices

Reply
 
Thread Tools Search this Thread
Old 05-05-2013, 11:45 AM   #1
Moonraker
Addict
Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.
 
Moonraker's Avatar
 
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
Monospaced fonts ignored in Kobo Aura

I have a science fiction book in which there are a lot of paragraphs in "machine code" for which I used a monospaced font "Courier New".

This font was in Sigil's Font Folder and also declared in the CSS stylesheet.

The Kobo Aura ignores this font and displays these paragraphs in the same font as the rest of the book.

I then removed all references to the "Courier New" font and nested these paragraphs in <code></code> but the font displayed is still the same as all the other paragraphs in the book.

I'm stumped.

Edit: I tried the book on my Kindle Keyboard and it works correctly.

Last edited by Moonraker; 05-05-2013 at 11:54 AM.
Moonraker is offline   Reply With Quote
Old 05-05-2013, 11:53 AM   #2
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,557
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Moonraker View Post
I have a science fiction book in which there are a lot of paragraphs in "machine code" for which I used a monospaced font "Courier New".

This font was in Sigil's Font Folder and also declared in the CSS stylesheet.

The Kobo Aura ignores this font and displays these paragraphs in the same font as the rest of the book.

I then removed all references to the "Courier New" font and nested these paragraphs in <code></code> but the font displayed is still the same as all the other paragraphs in the book.

I'm stumped.
Is it possible for you to attach the book to a message here? The full book is not needed, a chapter with the "machine code" and the stylesheet would be usable.

Regards,
David
DNSB is offline   Reply With Quote
Advert
Old 05-05-2013, 11:59 AM   #3
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: 73,660
Karma: 127838196
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Moonraker View Post
I have a science fiction book in which there are a lot of paragraphs in "machine code" for which I used a monospaced font "Courier New".

This font was in Sigil's Font Folder and also declared in the CSS stylesheet.

The Kobo Aura ignores this font and displays these paragraphs in the same font as the rest of the book.

I then removed all references to the "Courier New" font and nested these paragraphs in <code></code> but the font displayed is still the same as all the other paragraphs in the book.

I'm stumped.

Edit: I tried the book on my Kindle Keyboard and it works correctly.
Try the following...

font-family: monospace

in the appropriate CSS class.
JSWolf is offline   Reply With Quote
Old 05-05-2013, 12:16 PM   #4
Moonraker
Addict
Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.
 
Moonraker's Avatar
 
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
Here are my two files.

The first using the "Courier New" font.
And the second using <code></code> tags.

I did have my <code></code> tags outside of the <p></p> tags but Calibre changed them to inside the </p></p>

I did have font-family: "Courier New", monospace

in my CSS sheet
Attached Files
File Type: zip Epub Book 1 (04b).zip (1.50 MB, 271 views)
File Type: zip Epub Book 2 (04c).zip (301.5 KB, 276 views)
Moonraker is offline   Reply With Quote
Old 05-05-2013, 12:40 PM   #5
taming
Trying for calm & polite
taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.taming ought to be getting tired of karma fortunes by now.
 
taming's Avatar
 
Posts: 4,012
Karma: 9455193
Join Date: May 2010
Location: Mostly in Canada
Device: kobo original, WiFI, Touch, Glo, and Aura
I am assuming you did try "Document Default" as a font choice when you did this, right?
taming is offline   Reply With Quote
Advert
Old 05-05-2013, 01:04 PM   #6
Moonraker
Addict
Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.
 
Moonraker's Avatar
 
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
Quote:
I am assuming you did try "Document Default" as a font choice when you did this, right?
Yes, I did.
Moonraker is offline   Reply With Quote
Old 05-05-2013, 01:43 PM   #7
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,557
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Moonraker View Post
Here are my two files.

The first using the "Courier New" font.
And the second using <code></code> tags.

I did have my <code></code> tags outside of the <p></p> tags but Calibre changed them to inside the </p></p>

I did have font-family: "Courier New", monospace in my CSS sheet
I tried the one with the embedded font first and changed the font file names to match Kobo's required naming convention (*). On an Aura with 2.5.1, the segment at the end of chapter 10 showed happily using either Courier New or Dark Courier as embedded fonts. The copy I'm uploading has both embedded and Dark Courier selected. I also added a couple of bolded lines oin the boot sequence near the end of Chapter 10 just to play with the appearance.

For the copy using the <code>/</code>, Kobo does not supply a default monospaced font so this will not work. In my case, since I have a monospaced font in my sideloaded fonts, I used a reference to that font set which seems to work when I added the following to the stylesheet:

Code:
@font-face {
    font-family: monospace;
    font-weight: normal;
    font-style: normal;
    src: url('res:///fonts/normal/Dark Courier')
    } 
@font-face {
    font-family: monospace;
    font-weight: normal;
    font-style: italic; src: url('res:///fonts/italic/Dark Courier')
    } 
@font-face {
    font-family: monospace;
    font-weight: bold; font-style:
    normal; src: url('res:///fonts/bold/Dark Courier')
    } 
@font-face {
    font-family: monospace;
    font-weight: bold; font-style:
    italic; src: url('res:///fonts/bolditalic/Dark Courier')
    }

code {
    font-family: "Dark Courier", monospace;
    }
Unfortunately, that depends on having a monospaced font available which is not the case for the standard Kobo font set so the embedded font would be the better way to code your book.

Best I can do for now.

Regards,
David

(*) Kobo ereaders are very fussy about the font file naming. There have been several discussion on various threads. The best spot to look is the pinned "Summary of modified fonts" thread.
Attached Files
File Type: epub Epub Book 1 (04b).epub (1.67 MB, 330 views)
File Type: epub Epub Book 2 (04c).epub (304.0 KB, 327 views)

Last edited by DNSB; 05-05-2013 at 02:16 PM.
DNSB is offline   Reply With Quote
Old 05-05-2013, 02:17 PM   #8
Moonraker
Addict
Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.Moonraker ought to be getting tired of karma fortunes by now.
 
Moonraker's Avatar
 
Posts: 314
Karma: 1002965
Join Date: Mar 2006
Location: UK
Device: ILiad. Gen 3, PocketBook 360, Kobo Aura HD, Kindle Oasis 2
Quote:
I tried the one with the embedded font first and changed the font file names to match Kobo's required naming convention (*). On an Aura with 2.5.1, the segment at the end of chapter 10 showed happily using either Courier New or Dark Courier as embedded fonts. The copy I'm uploading has both embedded and Dark Courier selected. I also added a couple of bolded lines oin the boot sequence near the end of Chapter 10 just to play with the appearance.

For the copy using the <code>/</code>, Kobo does not supply a default monospaced font. In my case, since I have a monospaced font in my sideloaded fonts, I used a reference to that font set which seems to work when I added the following to the stylesheet:

Thank you David.

I put the book that you amended in my Kobo and it works!

I will have to be more careful with the naming of my fonts. I just assumed because it worked in my Kindle it should work with the Kobo. I have copied and pasted your answer into my "AllMyNotes Organizer" that I keep for scraps of code and other information. I shall digest it fully after I've had my dinner.

Thank you very much for your help and here's some karma for you.
Moonraker is offline   Reply With Quote
Old 05-05-2013, 02:29 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 34,557
Karma: 144552660
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Moonraker View Post
Thank you David.

I put the book that you amended in my Kobo and it works!

I will have to be more careful with the naming of my fonts. I just assumed because it worked in my Kindle it should work with the Kobo. I have copied and pasted your answer into my "AllMyNotes Organizer" that I keep for scraps of code and other information. I shall digest it fully after I've had my dinner.

Thank you very much for your help and here's some karma for you.
Glad to be of help. Just paying forward the help others have given me over the years. And thanks for the karma!

Regards,
David
DNSB is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Aura HD Kobo Aura HD samhy Kobo Reader 13 01-02-2014 03:38 PM
Aura HD Kobo Aura HD PeterT Kobo Reader 937 07-29-2013 06:02 PM
Kobo Kobo Aura HD hamlok Andere Lesegeräte 89 05-24-2013 07:35 AM
Kobo Aura Apps? jedipencil Kobo Reader 7 04-30-2013 01:05 PM
BD - how to get "monospaced" fonts? HarryT Sony Reader 9 04-21-2007 09:46 AM


All times are GMT -4. The time now is 01:38 AM.


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