|
|
#16 | |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 193
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Quote:
I have it set up in the CSS as .blog { display: block; font-family: "Courier Prime"; font-size: 100%; } And then <div class="blog"></div> around the text in question. It previews perfectly in the editor... |
|
|
|
|
|
|
#17 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 15,371
Karma: 248000001
Join Date: Jan 2014
Location: Estonia
Device: Kobo Sage & Libra 2
|
I think the code should be:
blog { display: block; font-family: "Courier Prime", monospace; font-size: 100%; } |
|
|
|
| Advert | |
|
|
|
|
#18 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,019
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The code should be:
Code:
blog {
font-family: monospace;
}
|
|
|
|
|
|
#19 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 193
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
Neither code worked.
Under Fonts in the left-hand menu of the Calibre Editor, there's four fonts. They all start CourierPrime - CourierPrime-Bold etc. I didn't name them that, they downloaded that way, so as far as I know that should be in their metadata as well? In the Manage Fonts menu, Courier Prime shows as embedded. Monospace (which appeared there after I tried one of the codes Sirtel and JSWolf suggested, I didn't notice which) is also listed, but there's no tick to say it's embedded. The start of my stylesheet looks like this Code:
@font-face {
src: url(CourierPrime-Bold.ttf);
font-family: "Courier Prime";
font-weight: bold;
font-style: normal;
font-stretch: normal;
}
@font-face {
src: url(CourierPrime-BoldItalic.ttf);
font-family: "Courier Prime";
font-weight: bold;
font-style: italic;
font-stretch: normal;
}
@font-face {
src: url(CourierPrime-Italic.ttf);
font-family: "Courier Prime";
font-weight: normal;
font-style: italic;
font-stretch: normal;
}
@font-face {
src: url(CourierPrime-Regular.ttf);
font-family: "Courier Prime";
font-weight: normal;
font-style: normal;
font-stretch: normal;
}
|
|
|
|
|
|
#20 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 52,865
Karma: 180988374
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
What Jon is talking about is adding the monospace font to the fonts directory in the root of your Kobo's storage which will allow you to use <code>...</code> or font-family: monospace;. It will not work with other brands. Embedding a monospace font is probably the most general solution. Looking at your sample CSS, the font source may be incorrect. The following works for me with the fonts in the ePub's OEBPS/Fonts directory:
Code:
@font-face {
font-family: 'Courier Prime';
font-weight: bold;
font-style: normal;
src: url('../Fonts/CourierPrime-Bold.ttf');
}
@font-face {
font-family: 'Courier Prime';
font-weight: bold;
font-style: italic;
src: url('../Fonts/CourierPrime-BoldItalic.ttf');
}
@font-face {
font-family: 'Courier Prime';
font-weight: normal;
font-style: italic;
src: url('../Fonts/CourierPrime-Italic.ttf');
}
@font-face {
font-family: 'Courier Prime';
font-weight: normal;
font-style: normal;
src: url('../Fonts/CourierPrime-Regular.ttf');
}
Last edited by DNSB; 07-02-2026 at 01:00 PM. |
|
|
|
| Advert | |
|
|
|
|
#21 | |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,019
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Last edited by JSWolf; 07-02-2026 at 02:20 PM. |
|
|
|
|
|
|
#22 |
|
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 193
Karma: 9400
Join Date: Aug 2010
Location: Helsinki
Device: Kobo Clara Colour
|
DNSB's epub displayed perfectly.
JSWolf's didn't, the text was normal, not monotype. So I guess that means the fonts I put in aren't working for some reason? I redownloaded them (from fonts.google.com, it's been my source for all my fonts, and previously everything I've gotten from there has been perfect), removed the first set from my Kobo, and put the newly-downloaded copies into the fonts folder. Still the JSWolf epub didn't display correctly. But I can select Courier Prime as a font, so it's definitely in there and the Kobo knows it's there. I have no clue what I'm doing wrong here. |
|
|
|
|
|
#23 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,330
Karma: 16800000
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
The following advice is for epub only (i.e. not kepub) on Kobos:
The fontname needs to be precisely Courier not Courier Prime. If you do it correctly [* see below] you won't need to embed the monospace font in the epub and a simple generic font-family:monospace; in the epub CSS will suffice. ETA: Also you won't need any @font-face statements for Courier in the epub's CSS. [*] "Doing it correctly" means that the Kobo needs to "see" the 4 font files you copy to the Kobo /fonts directory as having the fontname Courier not Courier Prime. This involves 2 steps:
Step 2 is a PITA if you're not familiar with font editors so you could *try* step 1 only but if that doesn't work then you will need both steps. I know this works because it's what I have, i.e. 4 x 'Courier Prime' ttfs masquerading as Courier. Last edited by jackie_w; 07-03-2026 at 09:25 AM. Reason: ETA: @font-faces |
|
|
|
|
|
#24 |
|
Resident Curmudgeon
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 84,019
Karma: 153695583
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
I think in this case, ttfedit will be easier to use.
I just had a look for Courier and I cannot easily find a font that's just Courier. I have no idea what version of Courier I have as Courier. But it's setup just as @jackie_w's instructions and it works as you see from my screen grab. |
|
|
|
![]() |
| Tags |
| css, kobo, small caps, smallcaps |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How widely supported are smallcaps? | Land_Outcast | ePub | 105 | 06-16-2024 12:46 AM |
| Reestablishing smallcaps | roger64 | Workshop | 8 | 05-27-2017 01:49 PM |
| smallcaps how to? | JSWolf | ePub | 20 | 06-02-2016 02:40 PM |
| Kobo bookstore on Kobo Touch not showing prices (Canada) | RobertJSawyer | Kobo Reader | 13 | 09-23-2012 08:30 PM |
| Smallcaps in Kindle | cscotts | Kindle Formats | 5 | 01-26-2011 09:52 AM |