View Single Post
Old 07-08-2019, 09:35 PM   #3
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: 46,754
Karma: 169712580
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by danabrams View Post
Hi all, I know this is a common problem, but I've spent a week and a half trying to follow the instructions on other posts to get monospaced fonts working on my Kobo Forma and it's just not working.

I've successfully installed patched firmware, I see the various Courier fonts I've installed as options in the fonts menu, and I've tried modifying the CSS via Calibre, but no matter what I do, I can't get monospaced fonts to work.

Since the primary use is to read programming books for work, this is frustrating to say the least. It works in plato, but not in the main reader.

Any help?
I'm going to assume that you have removed any font overrides from your CSS in the ebooks since they can and will keep font substitution from working.

As jackie_w asked, are you sending the books to your Kobo as epub or kepub?

In the librmsdk.so.0.0.1 yaml file, you can enable the Default ePub monospace font (Courier) patch which will then use your sideloaded monospaced file as the default. Alternate fonts will work but you may have to play games with the font names to fit into the maximum 7 characters for the font names.

I used to use a sideloaded font with CSS to use a monospaced font but the above patch allows to to simply refer to monospace/code in the CSS.

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;
    }

Last edited by DNSB; 07-08-2019 at 09:39 PM.
DNSB is offline   Reply With Quote