![]() |
#16 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,085
Karma: 144284144
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
delete post
Last edited by JSWolf; 06-08-2023 at 06:26 AM. |
![]() |
![]() |
![]() |
#17 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,085
Karma: 144284144
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#18 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Quote:
|
|
![]() |
![]() |
![]() |
#19 | |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,085
Karma: 144284144
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
![]() |
![]() |
![]() |
#20 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
My earlier post #15 shows the easiest method for standard epubs because you don't need to add any extra @font-faces to each epub to get CSS styles containing font-family:monospace to display in your sideloaded Courier font. The only disadvantage is that you need to go through the one-time font-renaming process if your favourite sideloaded mono font is not already named Courier (internally and externally).
If you want to avoid font-renaming (internal) then you need to add something like the following CSS to every epub that needs it: 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: bold; font-style: normal; src: url("res:///fonts/bold/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: italic; src: url("res:///fonts/bolditalic/Dark Courier"); } There's also the monospace patch in librmsdk.so.1.0.0.yaml. However, this is less useful than it used to be because when customising it you can only change the default value of Courier to a different font name of <= 7-chars. If you're going to have to do internal font-renaming anyway then you may as well just use the method in post #15. |
![]() |
![]() |
![]() |
#21 |
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 79,085
Karma: 144284144
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
@jackie_w Thank you for the correct CSS code.
|
![]() |
![]() |
![]() |
#22 |
Member
![]() Posts: 19
Karma: 10
Join Date: May 2020
Device: Kobo Clara HD
|
I apologize for disappearing. I left my Kobo in a seat-back pocket and only just now got a replacement. I used this guide to attempt to embed the monospace font into the kepub, but it still shows the preformatted text in non-monospaced font.
|
![]() |
![]() |
![]() |
#23 |
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Mar 2024
Location: India
Device: Kobo Libra 2
|
I was pulling my hair out over this issue and found the advise to add the fonts to my epub helped fix the issue in the resulting kepub file.
I had tried to edit and sideload a "Courier" font and changing the epub stylesheet to only have "monospace" for the related CSS rules but didn't help. Only got things to render after packaging the fonts in the epub file. I have two queries and I'd appreciate if someone could clarify these: 1. As of today, is there no patch that fixes this for kepub files? My understanding is that the patches only help in the case of epubs and not kepubs, including the Courier related one. 2. Is there any way right now to switch to a different sideloaded monospace font without having to add those fonts to the epub? |
![]() |
![]() |
![]() |
#24 |
Still reading
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,683
Karma: 103503695
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper
|
Mysteriously the Kobo by default doesn't include monospace. You have to embed a font. Maybe it works if you add the font to the reader, but that would be tricky to get right.
|
![]() |
![]() |
![]() |
#25 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,156
Karma: 237634549
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
Quote:
As to your issue, yeah, that's a kepub problem. Kepubs don't really like to display different fonts in one book. Me, if there's a book which uses many different fonts and it's important to the story, I'll just use epub. Last edited by Sirtel; 03-13-2024 at 10:47 AM. |
|
![]() |
![]() |
![]() |
Tags |
code, css, preformatted |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code View font choices | tetrault | Sigil | 3 | 05-28-2019 03:11 PM |
Change to interface font doesn't stick | eater | Calibre | 3 | 02-21-2018 03:46 PM |
Can't set preferred font in Sigil Code Editor window | GrannyGrump | Sigil | 2 | 01-26-2014 11:43 PM |
Calling all font and code experts | ltr | Kobo Reader | 7 | 12-09-2011 08:28 PM |
Changing font for code view mode | matthewyi | Sigil | 2 | 11-05-2009 02:20 PM |