04-09-2020, 07:17 AM | #1 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
Add fonts to Calibre epub
I'm having trouble with embedding fonts in Calibre. The conversion from docx to epub is no problem. Everything looks fine in the Calibre viewer, even the fonts.
But I only get to see the choosen fonts in the Calibre viewer. Not in Adobe Digital Editions, not in the e-reader on my iPhone. It doesn't matter whether or not I choose to embed the fonts I used in my docx or not. Nor does it seem to help if I install the fonts when setting up the conversion in Calibre. So I decided to see what I could do with CSS. When I edit my epub in Calibre, there is no mention of fonts on the left side (were all the CSS stuff is shown). Again, whether I've embedded them or not during the setup for conversion. It simply says Fonts: 0. In the stylesheet, both fonts I use, are mentioned (and again, whether I've embedded them or not during the setup for conversion). But are still only visible in the Calibre viewer. Not in ADE or on my phone. I've also tried it with a docx without the choosen fonts, hoping I could add the fonts when editing the epub. And I can't install the font families. I looks like it does, I can choose and add them, but they don't appear in the list. I'm using two Google fonts, so it should be working. How do I add fonts to the Font stylesheet mentioned on the left side of the edit screen? How do I make the fonts visible in other readers beside Calibre? Hopefully some of you have the solution for me! |
04-09-2020, 09:18 AM | #2 |
Not Quite Dead
Posts: 194
Karma: 654170
Join Date: Jul 2015
Device: Paperwhite 4; Galaxy Tab
|
It is hard to tell exactly what your problem is from the description. Also, it is possible that your e-readers do not display embedded fonts until a specific setting is made, as is necessary with Kindles.
Below are the steps I take to successfully embed fonts. Perhaps it will help you... 1) in Edit tool, import .ttf or .otf file previously downloaded from Google Fonts. Calibre will automatically put that file in its Fonts section. 2) in CSS file, add font-face rule. e.g. @font-face { font-family: "Lobster"; src: url(../Lobster_1.3.otf); } 3) add font to rules e.g. h2 { font-size: 2em; font-family: "Lobster", cursive; color: #8f0bf4; text-shadow: 2px 2px 2px #000; } |
Advert | |
|
04-09-2020, 10:56 AM | #3 |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
the other approach is to accept that the reader will select the font, not the author. both kindles and Kobo devices offer 6 or more fonts which you can select using the device menus( plus it is not hard to add fonts to the device, which all books can then access)
all that the book has to do is NOT try to enforce a font, so that the reader device can take control ( same goes for line heights, margins, justification ) can't speak for i phones, don't have one... but the apple philosophy is all users are idiots, lock everything down... so forcing any font to show up on an apple device may be problematic. |
04-09-2020, 12:29 PM | #4 |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Wy do you need to embed fonts? Are you doing this for yourself or to sell? If it is for yourself, what device and software are you using to read with?
If this is an eBook for sale, are you embedding a font that going to be used as the body font? If so, are you 100% sure you need to do this? Embedding a font for the body is not a good idea. |
04-09-2020, 12:37 PM | #5 |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The following code will embed the font ChareInk. The source URL will have to be changed for where your fonts are relative to he CSS. This embeds all 4 font styles in the font family.
Code:
@font-face { font-family:"ChareInk"; font-style: normal; font-weight: normal; src: url(../fonts/ChareInk-Regular.ttf); } @font-face { font-family:"ChareInk"; font-style: normal; font-weight: bold; src: url(../fonts/ChareInk-Bold.ttf); } @font-face { font-family:"ChareInk"; font-style: italic; font-weight: normal; src: url(../fonts/ChareInk-Italic.ttf); } @font-face { font-family:"CharInk"; font-style: italic; font-weight: bold; src: url(../fonts/ChareInk-BoldItalic.ttf); } |
Advert | |
|
04-09-2020, 12:40 PM | #6 | |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Code:
Font-family: "Lobster"; |
|
04-09-2020, 12:41 PM | #7 | |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
04-09-2020, 01:29 PM | #8 |
Well trained by Cats
Posts: 30,355
Karma: 58032210
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
The Calibre editor will offer up a CSS template when you add (import) a font file. (you do need to touch up the weight, style )
|
04-09-2020, 03:27 PM | #9 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
Thank you for your explanation. The problem is your first step. Calibre does not add the installed fonts to the fonts section. Only to the stylesheet.css. I thought that's why the fonts didn't show up in other devices.
Reading the other replies, I'm starting to doubt putting in my own fonts... |
04-09-2020, 03:28 PM | #10 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
That's food for thought, thank you so much! I'll reconsider putting in my own fonts.
|
04-09-2020, 03:29 PM | #11 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
It's for sale. Reading all the replies made me reconsider whether or not to put in my own fonts... Thank you!
|
04-09-2020, 03:31 PM | #12 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
Reading all the replies, I'm reconsidering putting in my own fonts. But if I decide to, I'll certainly give your css example a try! Thank you.
|
04-09-2020, 04:02 PM | #13 |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
04-10-2020, 04:35 AM | #14 |
Member
Posts: 18
Karma: 10
Join Date: Apr 2020
Device: none
|
I had fonts for both. But if I better not embed a font for the body text, then it's hardly necessary to embed one for the chapter headers. I can simply choose a serif font for the chapter headers to differ them from the (sans serif) body text.
|
04-10-2020, 06:11 AM | #15 |
Resident Curmudgeon
Posts: 75,816
Karma: 134321338
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Good idea to drop the embedded fonts. The other thing you would have to do is is check if the fonts you were going to embed were acceptable for use with eInk. A lot of fonts are too light for use with eInk. I've seen too many eBooks using Adobe Garamond to match the print edition and it's way too light for eInk.
|
Tags |
calibre, embedding, epub, font |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to embed fonts in ePub after Calibre | fiery | ePub | 79 | 12-05-2016 02:18 AM |
fontencrypt.py - Add Adobe encryption to fonts in ePub | pdurrant | ePub | 14 | 10-15-2013 09:16 AM |
How to add alternate fonts without replacing system fonts.(this time this is a guide) | techiemonkey | Kindle Developer's Corner | 17 | 09-12-2012 04:55 PM |
Calibre 6 and ePub changing fonts? | dordale | Calibre | 7 | 08-03-2009 04:30 PM |