![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
embedded fonts vs e-reader fonts
Here's a tiny sample of an embedded font experiment of mine:
Code:
<h1>Capitulum I</h1> <p><span class="courgette">Ea res est Helvetiis per</span> — courgette indicium enuntiata. Moribus suis Orgetoricem ex vinculis causam dicere coegerunt; damnatum poenam sequi oportebat, ut igni cremaretur.</p> Code:
@font-face { font-family: Courgette-Regular; font-weight: normal; font-style: normal; src:url(../Fonts/Courgette-Regular.otf); } .courgette { font-family: "Courgette-Regular", sans-serif; } As far as I can tell the e-reader I'm using, the Kobo Forma, doesn't let me change the base font, the one you get from specifying serif or sans-serif (or not specifying anything), when you use embedded fonts in its font settings. Its font setting choices are Publisher Default, which is what you use when the book has embedded fonts, or one of the built in fonts, Caecilia, Georgia, etc. If I don't specify a font for everything else then I get a font with pointy serifs, Georgia perhaps, but I would prefer a font with more slab like serifs. What I put in my css file is Code:
html { font-family: "Bitter-Regular", serif; } strong, b { font-family: "Bitter-Bold", serif; } em, i { font-family: "Bitter-Italic", serif; } h1, h2, h3 { font-family: "Bitter-Bold", serif; font-weight: bold; text-align: center; margin-bottom: 2rem; } Last edited by lumpynose; 05-23-2019 at 02:26 AM. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
I think I've figured it out; I need to have the font-family always be Bitter; e.g.
Code:
@font-face { font-family: Bitter; font-weight: normal; font-style: normal; src:url(../Fonts/Bitter-Regular.otf); } @font-face { font-family: Bitter; font-weight: bold; font-style: normal; src:url(../Fonts/Bitter-Bold.otf); } @font-face { font-family: Bitter; font-weight: normal; font-style: italic; src:url(../Fonts/Bitter-Italic.otf); } @font-face { font-family: Bitter; font-weight: bold; font-style: italic; src:url(../Fonts/Bitter-BoldItalic.otf); } Code:
body { font-family: "Bitter", serif; } strong, b { font-weight: bold; } em, i { font-style: italic; } |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
just a heads-up unless you are doing this only for your own use, on one device, you need to think through what could go wrong when that book is opened on other devices.
it is also easy { been there, don that} to get muddled when previewing results on PC which may not have your favorite font-of-the-day activated] in my case I had started using the amazon Caecilia font everywhere. I had copied it from Kindle to PC. Then I changed PC, forgetting that a new PC with a new install would not have that font.... |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@lumpynose,
I'm not sure whether you already know this, but if you're using a Kobo the easiest way to use Bitter as your standard font is to create a fonts directory in the root of your Kobo and copy the 4 Bitter .ttf files there. After a full power off/on you'll have Bitter as one of the options in the font list in the Aa pop-up. They should work fine no matter whether you're reading kepubs or standard epubs. Then you won't need to embed any fonts and you don't need any @font-faces. You need to follow the correct naming convention for the .ttf files but, based on your post #2, it looks like your Bitter files are already correctly named. Remove font-family completely from your body {...} CSS. This also helps to avoid problems if you want to read the epubs in a variety of epub reading apps. A couple of other FYIs:
|
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Ok, thanks.
I've figured out my problem in the second question, e.g., where I needed to use bitter bold for the strong and b tags. I'm not sure if you're answering my other, which is now an admittedly new question: if I have a class courgette as in my first example which uses an embedded font and there are no other @font-face or font-family things in my css, will the body font be Georgia? On the kobo using its reader I don't see any way to change that except to use an embedded font. On the other hand, with koreader, it does what I think is the right thing which is you can pick which font you want for the body font, when it's not specified in the css and you're using embedded fonts for just a class (e.g, a dingbat font or my courgette example). In other words, assume my first example with courgette is all that there is. Won't the other text be in Georgia? Last edited by lumpynose; 05-23-2019 at 01:03 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
![]() I know nothing about Koreader but, in general, if there are no @font-face and no font-family in your CSS then all text will be displayed in the font you choose from the Aa pop-up, which can be a built-in font or a sideloaded one. Both the kepub and the epub renderers have their own override CSS file which is used in conjunction with your Aa Font Face choice and the book's own CSS file. These 2 override CSS files (userStyle.css for epub, kepub-book.css for kepub) are not the same. The kepub one is more aggressive in its overrides than the epub one. I'm not 100% sure about this, but I think that if you choose the 'Publisher Default' font then the override CSS file is not used. It isn't actually true to say that you MUST choose 'Publisher Default' if you have any embedded fonts because it depends on where the embedded fonts are applied. ETA: The following strike-through info about font-family is true for plain epub but not kepub ... For example, if you have a fancy embedded font used only for headings (h1, h2 etc) then there is usually no need to choose 'Publisher Default'. You can quite happily select any font you like from the Aa menu to display your main body text and the headings will still display in the fancy font. Similarly, if you apply the fancy font in a <span> class, as per your Courgette example, you should also not need to choose 'Publisher Default'. It gets more tricky if you have <p class="courgette"> because, by default, both the epub and kepub override CSS's will zap it in favour of your Aa menu choice. In this case you would need to choose 'Publisher Default'. If you want to embed a font to be used for <body>, as per your Bitter example, then I'm pretty sure you do need to select 'Publisher Default' because both override CSS files will zap your body font-family if you don't. At this point, I have to confess that I have no idea why any Kobo user would want/need to embed a body font when it's so easy to sideload fonts. If the default override CSS files, for either epub or kepub, are causing you grief (as they do me) there are various Kobo patches available to bend them to your will. I won't elaborate right now. Have you lost the will to live yet ...? If not ... about the generic values for font-family:serif or sans-serif or monospace ... Once again, what you get depends on whether you're using epub or kepub. For epub these are hard-coded in the firmware as Georgia, Avenir and CourierStd respectively. As CourierStd does not exist on the Kobo it seems an odd choice! If you want to see a monospace font you need to take action. You could embed one if you insist but, once again, the Kobo patching system offers a much simpler solution. If we can see the firmware code we can patch it, so it's fairly easy to change these 3 generic fonts to our 3 favourites (built-in and/or sideloaded). I don't think anyone has found (yet) kepub equivalent patchable code for these generic font-family values but I think serif and sans-serif probably default to the same Georgia, Avenir as epub. I can't remember what monospace will display - probably Georgia or Avenir, I can't remember which. Whatever it is it won't be an actual monospace font. I could go on and on, but I think I'll stop now ![]() Last edited by jackie_w; 05-23-2019 at 07:55 PM. |
|
![]() |
![]() |
![]() |
#7 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
|
![]() |
![]() |
![]() |
#8 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Quote:
Code:
h1, h2, h3 { font-weight: bold; text-align: center; margin-bottom: 2rem; } h1 { font-size: 1.2rem; } h2 { font-size: 1.1rem; } h3 { font-family: "Courgette-Regular", sans-serif; font-size: 1.0rem; } Code:
<body> <h1>Capitulum I</h1> <p><span class="courgette">Ea res est Helvetiis per</span> — courgette indicium <i>enuntiata</i>. <b>Moribus</b> suis Orgetoricem ex vinculis causam dicere coegerunt; damnatum poenam sequi oportebat, ut igni cremaretur.</p> <h2 class="courgette">Capitulum I-A</h2> <p><span class="devonshire">Ea res est Helvetiis per</span> — devonshire indicium enuntiata. Moribus suis Orgetoricem ex vinculis causam dicere coegerunt; damnatum poenam sequi oportebat, ut igni cremaretur.</p> <h3>Capitulum I-B</h3> <p><span class="drsugiyama">Ea res est Helvetiis per</span> — drsugiyama indicium enuntiata. Moribus suis Orgetoricem ex vinculis causam dicere coegerunt; damnatum poenam sequi oportebat, ut igni cremaretur.</p> Last edited by lumpynose; 05-23-2019 at 07:23 PM. |
|
![]() |
![]() |
![]() |
#10 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
As per the instructions for the Kobo Touch Extended plugin I also installed the KePub Metadata Reader and KePub Metadata Writer plugins. I also have Kobo Utilities installed.
|
![]() |
![]() |
![]() |
#11 | ||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Quote:
Code:
* { font-family: %1 !important; } In comparison the plain epub default override for font-family is: Code:
body, p { font-family: -ua-default !important; } I've been patching the overrides on my own Kobos for years to be the same for epub and kepub using only Code:
body {font-family: ...} Last edited by jackie_w; 05-23-2019 at 08:25 PM. |
||
![]() |
![]() |
![]() |
#12 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
How are you looking at the firmware? On my pc I don't see the stuff I keep reading about. I'm also curious about installing the zork interpreter; I still have all of the infocom game files.
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Thanks for digging into it. The body font isn't that big of a deal, I was mainly just curious and was wondering if I'd overlooked something. If it really mattered I'd install koreader on my kobo; at the moment it's only on a piece of junk Boox Note Pro whose built in reader doesn't even do embedded fonts on epubs.
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
|
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,086
Karma: 6719822
Join Date: Jul 2012
Device: Palm Pilot M105
|
Ok, thanks. I'll just leave things as they are.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Embedded fonts | Hendrixxxxxxxx | Sigil | 8 | 01-25-2016 03:35 AM |
Glo Kobo fonts naming conventions and embedded fonts | roger64 | Kobo Reader | 0 | 05-09-2013 06:30 AM |
Embedded fonts | dicknskip | Sigil | 27 | 12-01-2011 09:24 AM |
Please confirm different embedded fonts OK in Sony reader | Maal656 | Sony Reader | 5 | 02-09-2011 02:45 AM |
Embedded fonts, Calibre, and choice of fonts | AlexBell | ePub | 8 | 05-30-2010 06:00 AM |